src: fix useless call in permission.cc#46833
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
addaleax
left a comment
There was a problem hiding this comment.
I agree that the current state here isn't ideal, but I'd rather fix it by doing proper error handling (i.e. return; on empty Maybe) than using .Check() and adding potential crashes here
|
@addaleax I went with |
|
@tniessen I think in ideal world we'd also handle errors from the string creation functions, but since they can only fail (afaik) if the strings exceed the maximum length of strings allowed by V8, and they (currently) only accept input that is already defined at compile time, so I don't have strong feelings about those (The extra |
|
@addaleax Thank you, that makes sense. I'll update it soon. |
FromMaybe() has no side effects and the return value is ignored. Instead, if Set() fails, then another exception is pending, so return early.
5989869 to
0e95c5a
Compare
|
Landed in 3abbc38 |
FromMaybe() has no side effects and the return value is ignored. Instead, if Set() fails, then another exception is pending, so return early. PR-URL: #46833 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
FromMaybe()has no side effects and the return value is ignored. UseCheck()instead to ensure that the operation succeeded.