Forum C# Development Server crashes And wont read the else statment

Development Server crashes And wont read the else statment

Postby oonka » October 10th, 2015, 9:36 pm

Today i'm getting a frustrating error maybe its my lack of sleep but it seems The player.io server crashes When I type the wrong code into my Get item system The system works perfectly when I enter the right code But when I enter the wrong code it should Read the else statement the broadcast code not found instead it Crashes .


Screen shot of the crash error : http://imgur.com/gallery/gXjSexs/new
oonka
 
Posts: 22
Joined: October 10th, 2015, 9:19 pm

Re: Development Server crashes And wont read the else statme

Postby Guillaume » October 10th, 2015, 10:00 pm

You are having a null reference exception.

Can you check that message.Length > 0 ?
Are you sure that the sent data is always a string ?
Guillaume
 
Posts: 277
Joined: March 28th, 2014, 1:59 am
Location: France

Re: Development Server crashes And wont read the else statme

Postby oonka » October 10th, 2015, 10:09 pm

Yes Say the right code was 123456789 and i enter that 123456789 code it all works but when i enter that wrong code it all go's to shit
oonka
 
Posts: 22
Joined: October 10th, 2015, 9:19 pm

Re: Development Server crashes And wont read the else statme

Postby Guillaume » October 10th, 2015, 10:33 pm

I think you did something wrong in your code somewhere, because you can always handle a NullReferenceException before it happen.
Also, have you tried to check if the message object is not null ?

At least, if you don't find any right solution, can't you try to embed your code in a try { } catch { } statement ?
Guillaume
 
Posts: 277
Joined: March 28th, 2014, 1:59 am
Location: France

Re: Development Server crashes And wont read the else statme

Postby oonka » October 10th, 2015, 10:37 pm

I guess so ill give it a try! Thanks
oonka
 
Posts: 22
Joined: October 10th, 2015, 9:19 pm


Return to C#



cron