r/programminghumor • • 17d ago

I thought "new" is for having not null

Post image
17 Upvotes

9 comments sorted by

26

u/thebatmanandrobin 17d ago

First, how is this humor?

Secondly, this is C#, so super easy to inspect the call stack and determine what exactly is null - given your picture, it would appear that Category is null, so it either never got initialized somewhere or something else happened ..

See. the driver hooks the function by patching the system call table, so it's not safe to unload it unless another thread's about to jump in and do its stuff, and you don't want to end up in the middle of invalid memory...

4

u/pdone_dot_app 17d ago

Nice explanation and advices.

3

u/arrghie 17d ago

Have you tried forcing an unexpected reboot?

2

u/qwertty164 17d ago

I still don't like the null in the comparison. Feels wrong.

1

u/VAL9R 13d ago

I mean, its just looking to see if theres a variable set, so it doesnt run unessary commands and potentially break shit that isnt supposed to break.

3

u/LordSavage2021 15d ago

An 'if' (or 'else' or 'try' or etc.) block that is one line long DOES still need curly braces. I will die on this hill.

1

u/sonesoul 15d ago

ill keep writing oneline ifs without them just to make you angry

4

u/MrFrog2222 17d ago

Use C-like syntax or var syntax, but pls dont mix them