-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
[Fix] Fix bug with missing license information #22485
Conversation
Pinging @elastic/apm-ui |
💚 Build Succeeded |
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.
Looks good -- any reason not to do
get(license, 'data.some.path')
instead of get(license.data, 'some.path')
in these cases?
I try to avoid When I do use That's at least the reasoning I tell myself :) |
@sqren yeah this makes sense with null pointer bugs and all that, I think at some point I changed my mind on this a bit in some cases where I know I want to avoid bubbling that error up to the user in either case. Being able to log something about the unexpected undefined value would be a nice middle ground but I don't know that we have a good way to do that. Out of curiosity: would an ErrorBoundary have let us show a more useful screen when that value was undefined/blew up? We used them a bit but I was always a little fuzzy on how they work tbh. |
What I'm hoping is that the error will never make it to the user, since it'll be obvious in dev-mode when everything explodes - but that also sounds like a dangerous way to code, when I put it like that, so I'm on the fence :) I haven't really used ErrorBoundaries yet but they sound useful. |
I thought that license information would always include something like:
Turns out we can't rely on this being available, so have to guard the accessors with lodash.
TODO: