Read the stack trace properly
The useful line is rarely the top one.
Full stack trace: <paste all of it, not just the last line> The code at the line it points to: <paste, with surrounding context> Walk me through it: 1. Read from the bottom up — what was the chain of calls? 2. Which is the first frame that's MY code rather than a library? That's where I should look. 3. What does this error type actually mean? 4. What value was probably not what my code assumed? 5. The fix, and what I could have logged to spot this in seconds.
Pasting only the last line loses most of the information. The chain of calls above it is what tells you how you got into the broken state.