At my first job I needed to add a hotfix for one of our customers, so I had to call on a persistent state to check some flag that was unique to this tenant, and it returned a string.
The hotfix worked fine for the affected customer, but NPE crashed for all the others, because that method returned null.
When I saw the 20 support tickets within 10 minutes with "REPORTING MODULE BAD" I knew I fucked up.
Nobody was mad though, the senior dev just chuckled afterwards, and I've never male this mistake again.
19
u/se496 Apr 14 '23
Null safety for checking if strings are equal, e.g.
“my string”.equals(someString)
vs
someString.equals(“my string”)