mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-05-04 18:09:12 +03:00
[PR #4212] [MERGED] Null Pointer fix: BaseControlHandler.cs #9949
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/jellyfin/jellyfin/pull/4212
Author: @BaronGreenback
Created: 9/25/2020
Status: ✅ Merged
Merged: 10/10/2020
Merged by: @dkanada
Base:
master← Head:BaseControlHandlerFix📝 Commits (10+)
86ad04bUpdate DescriptionXmlBuilder.csc2e2e5aUpdate DescriptionXmlBuilder.csa6400d1Update DescriptionXmlBuilder.csd99db54Update DescriptionXmlBuilder.cs293237bUpdate BaseControlHandler.cs12b5f11Update DescriptionXmlBuilder.csf3a90baUpdate DescriptionXmlBuilder.csa52ab69Update DescriptionXmlBuilder.cs6357157Update BaseControlHandler.cs7567779Update BaseControlHandler.cs📊 Changes
1 file changed (+19 additions, -6 deletions)
View changed files
📝
Emby.Dlna/Service/BaseControlHandler.cs(+19 -6)📄 Description
The first instance in within a try/catch block in ProcessControlRequestAsync. It calls ProcessControlRequestInternalAsync, which in turn calls ParseRequestAsync.
ParseRequestAsync searches for a body tag - but returns an empty ControlRequestInfo object if none is found.
ProcessControlRequestInternalAsync proceeds to try and output settings from this object that aren't initialised (hence null pointer).
As the code is in an exception block, this won't currently crash, however, putting in the exception is a cleaner solution - and goes towards making the function nullable.
The second instance is in ParseBodyTagAsync where under certain circumstances it is possible to get an empty ControlRequestInfo object.
The final change is creating a constructor for ControlRequestInfo, which makes it nullable.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.