Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Search - "nullpointerexception"
-
Did this on my first programming exam.
int index = 0
int value = 0
try {
while true {
value += array[index]
index++
}
} catch NullPointerException {
System.out.print("Sum: " + value)
}
The task was to add together all numbers in an array.
I somehow aced the exam, but got called in to teachers office this is not the way to use exceptions.7 -
If programming languages where weapons...
1. C is an M1 Garand standard issue rifle, old but reliable.
2. C++ is a set of nunchuks, powerful and impressive when wielded but takes many years of pain to master and often you probably wish you were using something else.
3. Perl is a molotov cocktail, it was probably useful once, but few people use it
4. Java is a belt fed 240G automatic weapon where sometimes the belt has rounds, sometimes it doesn’t, and when it doesn’t during firing you get an NullPointerException, the gun explodes and you die.
5. Scala is a variant of the 240G Java, except the training manual is written in an incomprehensible dialect which many suspect is just gibberish.
6. JavaScript is a sword without a hilt.
7. Go is the custom made “if err != nil” starter pistol and after each shot you must check to make sure it actually shot. Also it shoots tabs instead of blanks.
8. Rust is a 3d printed gun. It may work some day.
9. bash is a cursed hammer, when wielded everything looks like a nail, especially your thumb.
10. Python is the “v2/v3” double barrel shotgun, only one barrel will shoot at a time, and you never end up shooting the recommended one. Also I probably should have used a line tool to draw that.
11. Ruby is a ruby encrusted sword, it is usually only used because of how shiny it is.
12. PHP is a hose, you usually plug one end into a car exhaust, and the other you stick in through a window and then you sit in the car and turn the engine on.
13. Mathematica is a low earth orbit projectile cannon, it could probably do amazing things if only anyone could actually afford one.
14. C# is a powerful laser rifle strapped to a donkey, when taken off the donkey the laser doesn’t seem to work as well.
15. Prolog is an AI weapon, you tell it what to do, which it does but then it also builds some terminators to go back in time and kill your mom
All credits go to Vicky from damnet.com5 -
Catching a NullPointerException so that it can cause another NullPointerException to the caller. 🤯11
-
Whilst I was gaming this morning, I found A person with the username 'NullPointerException' so I imediatly typed into the chat
"catch(NullPointerException e){}"1 -
Every fu**in time!!joke/meme funny android crash ++ shower java nullpointerexception exception c++ runtime errors meme/joke4
-
There are in fact three unique Boolean values.
Their names are "true", "false", and
java.lang.NullPointerException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
...12 -
To all newbie developers,
Before you ask a doubt about an issue to someone else,
Try doing an initial investigation to find the root cause,
Look into the logs,
Find the stack trace,
Google things,
Have breakpoints and try to debug.
You come to me with a weird NullPointerException and ask me why,
Without even looking into the logs once? We ain't God bro.13 -
Wtf, really??? Are they trying to liyerally KILL ME????
Got home from hospital today wth my family. Baby got sick. Wife also caught cold... Bad news. It was just me still healthy like a raddish [we have such saying].
So I got home. Started feeling somewhat funny. Sore thighs, feeling nauseaus, chilly, a bit dizzy.
10 minutes later I'm fucking trembling! It felt as of I was kicked put bare ass to -20C outside! I'm not exaggerating [probably made some typos.. Pls correct me] - i live where winters get like -35C. Everything around got like twice darker. And my lower teeth got itchy af [NOT the best feeling, trust me].
I must have caught cold too - I thought to myself, cuz I know what these sympthoms mean. I always have 'em all when I have fever. Since shivers are caused by rising fever I got my Microlife remote thermometer out of my drawer. Click, blue light, wait, beeep. 36.5C. Allright.. Maybe I got it wrong... Try again -- same result. Wife also gave a couple tries - nada. Nil. Nullpointerexception. Healthy like a pickle!
10 minutes later I couldn't stand the cold. Got under my blankets wife made some soup, tea,... I still have this analog thermometer, the one with quicksilver. Pop it into my armpit - jusyt in case. 10minutes later I take it out. It says 39,5 and rising. Try the microlife again. 36,5. WHAT THE FUCK?????????
If I weren't so fond of old-school stuff I'd be in a fucking ER now!!
Fuck you medical digital equipment made to be used at home! FUCK YOU!!
I'm pissed.
Do you folks kbow where could I get those q-silver thermometers? Just in case. They're already out of matket in my area for quite some time... For being dangerous [i give 'em that, okay?] and.... Lisen to this.... "unreliable"!
FUCK IT!15 -
You run a bank with over 10million customers and can't handle a nullpointerexception error.And java ssly.18
-
Coworker: I've got an error, can't figure it out...
Me: Send error
Coworker: NullPointerException
Me: fml
Sr. my balls.1 -
When you test your backend code thoroughly before pushing to production, but a fatal exception with the much larger production userbase causes one of your vital threads to die with a NullPointerException.6
-
The intern: FUUUUCK, WHY ISN'T MY CODE WORKING?
Me: Lemme check real quick... ok, that's a null pointer exception.
The intern: Again? Man, I'm growing desperate. How do I stop making these errors?
My dumb ass with my 4 years coding experience, who encountered a nullpointerexception literally 5 minutes earlier: """"°-°""""11 -
2 days to find where the NullPointerException came from, in a nearly 150 tables database. Once I found it I feel like the guy who found the grain of sand blocking the whole machine.2
-
> Johnny Johnny
> Yes Papa!
> Using Java?
> No Papa!
> Telling lies?
> No Papa!
> Open your mouth
> NullPointerException
Ref :
https://youtu.be/F4tHL8reNCs6 -
No. Just no. The null pointer exception didn't come from my DB, it came from your Java code, so go away and fix it.2
-
class Life extends Death{
public static void main(String...args){
Guy me = new Guy();
me.born();
GirlFriend gf = new GirlFriend();
me.setGirlFriend(gf);
me.getMarried();
me.haveSon();
me.die();
}
}
------- Exception on line 5: NullPointerException, girlfriend cannot be null ---
Daaamnn6 -
So, a friend of mine just got a NullPointerException from his shitty Java code, and decided to fix the problem by catching the exception.
Great fix bro, real smooth..1 -
No matter how experienced you were on Java, you'd still got this little friend around you -> "java.lang.NullPointerException"1
-
They say if you throw good stuff out at the universe, it will throw good stuff back. But all it ever throws for me is a NullPointerException.2
-
In 3rd year of college my friend decided to get rid of all his NullPointerException by instantiating all his strings as "null"...2
-
I was at Argos a few days back. After browsing I went over to one of the machines to order. Just as I was about to search for the item I required the program crashed... Bloody NullPointerException! I spent the next 20 minutes reading the error message working out what the issue was wishing I could access the codebase and fix it.
Has anyone else experienced this uncontrollable urge?1 -
//run every weekday afternoon
public void workIsOver(int hoursOvertime){
int beerCount = 1;
if (hoursOvertime > 1){
beerCount++;
}
startCar();
int timeHomeMinutes = 20 + Traffic.getTimeLostStuckInTrafficToday();
if (timeHomeMinutes > 40) {
beerCount++;
}
Boolean finallyAtHome = true;
if (goToFridge.checkStock("beer") < beerCount){
Log.e("Dude","WTF?");
}
drink("beer");
while (!girlfriendAtHome){
if (stash != 0){
Joint joint = new Joint(stash);
joint.blaze();
} else {
Log.e("Dude","Seriously?");
}
startAndroidStudio();
workOnSideProject(getCurrentSideProject());
}
girlfriend.communicate();
new AsyncTask<>(thinkAboutCodingInBackground()).execute();
if (bedTime){
try {
doSomeBedroomPartying();
} catch (NullPointerException e) {
Log.w("Sorry","not today");
}
activity.finish();
}
}1 -
I am learning java at school and my teacher asked me to make a work on JTA (java transaction API). There's not a lot of tutos on it on the web so I say to myself "go on, give it a try, you'll only learn by trying."
I finally find how to make the @TransactionType, where to put the @Stateless, my test works, nice. Finally I want to try a case where it shouldn't work, just to be sure the rollback works well. The test goes and... NullPointerException. Wtf ! Normally, my catch is supposed to, well, catch the error !
And finally, I was just stupid. My catch worked great. But I put a "throw e" inside.
Now I wanna hides under blankets, cry, eat cake and never see my coworkers again.2 -
When a PM or other self proclaimed demi god decides to tap the shoulder of the programmers with headphones on just to look just above their head and say "oh, i see. a programmers thoughts do throw a nullPointerException when disrupted"1
-
It would be much easier when a NullPointerException would log also what is null. Instead of just the line.... with multiple possibilities........5
-
I left on vacation only to realize I pushed an old build to production. It now throws NPEs.
I don't have a computer, just my phone.
I'm regretting not going to bed earlier yesterday.1 -
When i see a NullPointerException i look into my monitor with tears in my eyes and sing -
Tu hi yeh mujhko bata de,
Chahu mai ya na,
Apni exception ka pata de,
Chahu mai ya na11 -
I've been trying to add a click listener to this image of john cena but I keep getting a NullPointerException, somebody help!!!!12
-
Got anymore runtime exception handlers with that?
When a paid service that promises a million connection types can't even do an initial sync 🤦♂️. Back to bash scripting it is... -
NullPointerException: Object reference not set to an instance of an object.....ummm what was null?
How much longer must we wait for a language that tells you the variable name that was null?2 -
Have I ever mentioned my undying love of NullPointerException?
I love those so fucking much I would give up my non existent social life for it.
This is a cry for help please help2 -
I'm having such a bad day, that an exception object passed on to my catch block itself caused a NullPointerException.1
-
Was struggling with a NullPointerException that apeared on a test machine of a standalone spring boot app I'm developing...
5 hours latter I found the reason by accident....
The default session timeout was too low...
Increased that bitch to 10 hours and don't rely on session anymore to pass data... -
Fucking shitty ass educational products fucking really suck. Literally, one of the schools we work for has a piece of software called Blackboard that seems great and all until you realize that its written in Java and you have students and teachers who barely know how to turn on a computer using this thing! I'm not even kidding when I say that one student can bring the entire thing to its knees just by causing it to throw a NullPointerException and to make matters worse teachers are allowed to customize their "classrooms" which as part of that they are allowed to add plugins. Some of which also cause fucking headaches and NullPointerExceptions. The least these fuckers could have done was switched their code to Kotlin or something that could actually handle improper types without crashing the whole damn thing.6
-
Got a call about production was going to fail. They thought it's the application server.
I'm the end it was bogus file mods which were scrambled by the backup tool.
Why we didn't find out earlier? Because the java application was coded like this:
-------
String content;
Try {
File bla = new File
content = ... Read operation
} catch (IoException | SecurityEx | RuntimeEx ex)
// nothing we can do here
}
doWork(content);
---------
Why the fuck do we have code reviews? Why not just log or throw a Runtime Exception? Argh... I thought it would be better in enterprise applications. Perhaps I should tell them to not just use pmd, also spotbugs and sonarqube. But the department for the build tools does not have enough employees. Dang.
Anyway. Earned some money for that.
Now it's 2018 and I still get money for the same kind of bugs as 2008.3 -
Spent about an hour and a half getting an NPE. Cleaned the project, rebuilt, restarted IntelliJ, danced the ancient code dance... Nothing.
Clicked Run one more time and everything worked. TF was that about? I HATE these types of bugs!!1 -
!rant
How do I set a default value for a dropdown if no option is selected?
I tried
<option value="">Select one option</option>
or value="0"
It gives me a NullPointerException10 -
Java's such a bitch, it won't house pointers but throw a NullPointerException at even the most insignificant lines possible.1
-
Sweet Zombie NullFuckingPointerException...
New Rule: When creating an API (I'm looking at you, Java), designers must include a boolean flag in the parameter list of any method which throws a NullPointerException.
If TRUE, this means that a NULL result is non-trivial and the method should therefore THROW an NPE.
If set to FALSE, this means that NULL is completely f*cking trivial so whenever there's a NULL result, just instantiate a new instance of the return type and return that, 'cause that's what was gonna happen in the catch block of the NPE anyways.2 -
Interview tooday im so fucking nervous again ... In Québec city the job you can have without a car is so fucking NullPointerException1
-
Hit into NullPointerException on production then I saw this in the source code,
entity.getKey().getValue().contains("a string"):2 -
Just saw a job listing looking for an advanced web engineer using JAVA and one of the requirements was a bachelor in computer science...
Hate to tell you guys but anyone with a bachelor in computer science is smart enough to not touch Java, even with a NullPointerException();8 -
When I don't code with IDE support, I will be like is it NullpointerException or NullPointerException
-
PM needs experiments running this weekend. One set has a NullPointerException. Just told him to tell me when he's fixed it. He's been painful to work with, that at this point I have no empathy. Just cackling as it's not my problem until Monday! 😂
-
Biggest deceit in Java developer's life : this value can never be null, leave that extra null check.1