-
Notifications
You must be signed in to change notification settings - Fork 99
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
Don't crash OsIcon when osCpe or osTxt are undefined #1975
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.
From the patch view I can't really see the cause of the issue but I guess real issue is below the changed code. What's the return value of OperatingSystems.find('') now?
Codecov Report
@@ Coverage Diff @@
## gsa-9.0 #1975 +/- ##
===========================================
- Coverage 49.02% 49.01% -0.01%
===========================================
Files 1067 1067
Lines 24958 24960 +2
Branches 7026 7053 +27
===========================================
Hits 12235 12235
- Misses 11564 11566 +2
Partials 1159 1159
Continue to review full report at Codecov.
|
It now returns undefined, if it receives an empty string as name-param. The issue was that it crashed when name was undefined and .include() couldn't be called at all. The real issue definitely lies deeper and has been discussed across several teams in the last days. With this small fix we just take care that whenever this kind of situation comes up again, GSA doesn't crash and at least allows the user to continue work. |
Hmm after looking at the code and your changes again, I don't get how your PR fixes a problem. For me it doesn't really change the behavior. |
The only case were it could crash is if osTxt is defined and not a string. In that case neither the old nor the new code works. |
Don't crash OsIcon when osCpe or osTxt is undefined
Don't crash OsIcon when osCpe or osTxt is undefined
Checklist: