fix: Handle unknown item types gracefully in DeserializeBaseItem

When querying items with recursive=true, items with types from removed
plugins would cause a 500 error. Now these items are skipped with a
warning log instead of throwing an exception.

Fixes #15945
This commit is contained in:
ZeusCraft10
2026-01-05 21:08:26 -05:00
parent a1e0e4fd9d
commit 0ff869dfcd
3 changed files with 100 additions and 19 deletions

View File

@@ -1247,8 +1247,11 @@ internal class MigrateLibraryDb : IDatabaseMigrationRoutine
}
var baseItem = BaseItemRepository.DeserializeBaseItem(entity, _logger, null, false);
var dataKeys = baseItem.GetUserDataKeys();
userDataKeys.AddRange(dataKeys);
if (baseItem is not null)
{
var dataKeys = baseItem.GetUserDataKeys();
userDataKeys.AddRange(dataKeys);
}
return (entity, userDataKeys.ToArray());
}