-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Fix null reference exception in user agent handling #3946
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes a null reference exception in the JobRunner class by adding proper null safety checks when handling user agent orchestration IDs. The changes ensure that user agents are loaded before accessing them and add defensive programming practices to prevent runtime exceptions.
Key changes:
- Added call to
LoadDefaultUserAgents()to ensure user agents are initialized - Added null checks for
UserAgentscollection andProductproperty - Applied null-conditional operator for safer collection insertion
blaze27444
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix null
Ensure that user agents are loaded and checked for null values to prevent null reference exceptions when processing orchestration IDs.