Author Topic: throw null;  (Read 3416 times)

0 Members and 1 Guest are viewing this topic.

Offline Camel

  • Hero Member
  • *****
  • Posts: 1703
    • View Profile
    • BNU Bot
throw null;
« on: September 16, 2009, 01:47:00 pm »
...will crash your catch block

discuss

<Camel> i said what what
<Blaze> in the butt
<Camel> you want to do it in my butt?
<Blaze> in my butt
<Camel> let's do it in the butt
<Blaze> Okay!

Offline iago

  • Leader
  • Administrator
  • Hero Member
  • *****
  • Posts: 17914
  • Fnord.
    • View Profile
    • SkullSecurity
Re: throw null;
« Reply #1 on: September 16, 2009, 02:12:14 pm »
You shouldn't go throwing things that don't exist. Liable to cause an anomaly, it is.

Offline Sidoh

  • x86
  • Hero Member
  • *****
  • Posts: 17634
  • MHNATY ~~~~~
    • View Profile
    • sidoh
Re: throw null;
« Reply #2 on: September 16, 2009, 07:24:41 pm »
is that kind of like tricking a dog into running after nothing while playing fetch?

Offline rabbit

  • x86
  • Hero Member
  • *****
  • Posts: 8092
  • I speak for the entire clan (except Joe)
    • View Profile
Re: throw null;
« Reply #3 on: September 16, 2009, 07:35:01 pm »
Or naming it "Stay" and telling it to "come here" all the time?

Offline MyndFyre

  • Boticulator Extraordinaire
  • x86
  • Hero Member
  • *****
  • Posts: 4540
  • The wait is over.
    • View Profile
    • JinxBot :: the evolution in boticulation
Re: throw null;
« Reply #4 on: September 16, 2009, 07:59:46 pm »
...will crash your catch block

discuss
In .NET I'm pretty sure it would simply generate a NullReferenceException (analogous to NullPointerException in Java) in the stack frame in which the "throw null" existed which could bubble up to a higher stack frame with the appropriate handler.

Is that it?
I have a programming folder, and I have nothing of value there

Running with Code has a new home!

Our species really annoys me.