diff options
| author | zerafachris <christopher.zerafa@blocklabs.io> | 2026-07-17 17:20:30 +0200 |
|---|---|---|
| committer | zerafachris <christopher.zerafa@blocklabs.io> | 2026-07-17 17:20:30 +0200 |
| commit | 5cd3d7ebb7c8ce5b7cf68b0696543780215a6fff (patch) | |
| tree | 2be721b5a44996332e80608fa9991a40cb872b45 /Emby.Common.Implementations/TextEncoding/NLangDetect/Profiles/ron | |
| parent | a96dc8bd9b1e2fc2a897a7d73839abf5bc5b81d4 (diff) | |
fix: don't throw ArgumentNullException on partial UpdateItem payloads (#17366)
BaseItemDto.Genres, .Tags, and .ProviderIds are plain auto-properties with
no default initializer, so they deserialize to null when a client omits
them from a partial POST /Items/{itemId} body. The OpenAPI spec documents
every BaseItemDto field as optional, but ItemUpdateController.UpdateItem
fed these three properties straight into Distinct()/Select()/ToList()
without a null check, so a request that (for example) only sets Tags
throws ArgumentNullException("source") once it reaches the unguarded
Genres line, before Tags is even processed.
Guard all three assignments with the same "if (request.X is not null)"
pattern already used for the neighboring Studios/Taglines/ProductionLocations
fields in this method, so omitted fields are left unchanged instead of
crashing the request.
Adds ItemUpdateControllerTests covering the reported repro (only Tags
supplied) and a companion case asserting existing Genres/ProviderIds are
preserved when omitted from the payload.
Signed-off-by: zerafachris <christopher.zerafa@blocklabs.io>
Diffstat (limited to 'Emby.Common.Implementations/TextEncoding/NLangDetect/Profiles/ron')
0 files changed, 0 insertions, 0 deletions
