chore: add safety checks to NoteCommand - #1086
Conversation
|
It is intentionally kept like that, because the values can never be null |
There was a problem hiding this comment.
this change is small, a bit unnecessary but totally okay.
both approaches are totally fine and valid. intentionally triggering a NPE by using a possibly-null-but-required-not-null object versus explicitly using Objects.requireNonNull are both valid and almost identical.
we had a lengthy discussion on this matter in the past and decided to accept both ways.
generally, id suggest to not run through the entire code base and substitute one by one. but i have nothing against this PR, nor if ud use that style while writing a feature.
just don't make PRs only for that (opinionated) change, i guess.
fine for now though 👍
|
Approving + merging as I have tested the behavior. An exception is fine even though unlikely to occur. The exception won't leak out any important information or crash the bot so this is good to go. |
Resolves #1085