Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This continues the work in #250 by adding some checks to ensure we don't call interface methods on a nil interface.
You could argue that the caller should always make sure not to pass in a nil interface. I don't disagree, I think that is still best practice. But this check is cheap, we can handle it in a reasonable way, and it prevents a runtime panic. Panics should be reserved for "I have no idea what I should do next, it's best to crash". We know what is reasonable to do here, so no need to crash.