Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Apr 19th, 2006, 2:05 PM   #1
Kilo
Expert Programmer
 
Kilo's Avatar
 
Join Date: Nov 2005
Location: In Pink Clam?
Posts: 542
Rep Power: 0 Kilo is an unknown quantity at this point
Send a message via AIM to Kilo
The Sickness!

Im SO SICK AND TIRED OF THIS ERROR! Im at work right now and we have been writing a semi-large program for our department in C#. A very common error we recieve is

Object reference not set to an instance of an object...

WHICH IS BSSSSSS. We could run the same code 100 times before the errors starts.. what is causing this why does this keep happening.

below is the most recent time it happened

[php]
private bool PipeValidation(string pipeVal)
{
for(int i=0; i<pipeVal.Length; i++) //this is the problem line
{
if(pipeVal[i] == '|')
{
return false;
}
}

return true;
}
[/php]
__________________
"When in Rome, Do as the Romans Do"
"Beauty is in the eye of the BEER holder"
"Save your breath your going to need it for your blow up doll later"

SearchLores.org
Kilo is offline   Reply With Quote
Old Apr 19th, 2006, 3:30 PM   #2
Kilo
Expert Programmer
 
Kilo's Avatar
 
Join Date: Nov 2005
Location: In Pink Clam?
Posts: 542
Rep Power: 0 Kilo is an unknown quantity at this point
Send a message via AIM to Kilo
this has to be a record... 30 minutes with no reply?
__________________
"When in Rome, Do as the Romans Do"
"Beauty is in the eye of the BEER holder"
"Save your breath your going to need it for your blow up doll later"

SearchLores.org
Kilo is offline   Reply With Quote
Old Apr 19th, 2006, 4:32 PM   #3
nnxion
Programming Guru
 
nnxion's Avatar
 
Join Date: Jun 2005
Location: elemental plane
Posts: 1,429
Rep Power: 5 nnxion is on a distinguished road
That's not the problem, show us more of the code.
Btw why not use IndexOf?
__________________
"Employ your time in improving yourself by other men's writings, so that you shall gain easily what others have labored hard for."
-- Socrates

Last edited by nnxion; Apr 19th, 2006 at 4:45 PM.
nnxion is offline   Reply With Quote
Old Apr 19th, 2006, 5:02 PM   #4
OpenLoop
Expert Programmer
 
OpenLoop's Avatar
 
Join Date: May 2005
Location: East Lansing, MI
Posts: 663
Rep Power: 4 OpenLoop is on a distinguished road
Kilo, what makes you think that the problem is there. Sometimes, the Null error points to the wrong line. Check the code executed before this one.

BTW, bitching about slow response won't get you anywhere. Be nice to people dedicating their time to help.
OpenLoop is offline   Reply With Quote
Old Apr 19th, 2006, 5:07 PM   #5
Pedja
Programmer
 
Join Date: Nov 2005
Location: Belgrade, Serbia & Montenegro
Posts: 31
Rep Power: 0 Pedja is on a distinguished road
Send a message via ICQ to Pedja Send a message via MSN to Pedja Send a message via Yahoo to Pedja
It seems that at some point pipeVal is passed to the function without having been initialized.
Pedja is offline   Reply With Quote
Old Apr 19th, 2006, 5:48 PM   #6
nnxion
Programming Guru
 
nnxion's Avatar
 
Join Date: Jun 2005
Location: elemental plane
Posts: 1,429
Rep Power: 5 nnxion is on a distinguished road
@Pedja: pipeVal is the parameter. I'm pretty sure it gets passed to the function.
__________________
"Employ your time in improving yourself by other men's writings, so that you shall gain easily what others have labored hard for."
-- Socrates
nnxion is offline   Reply With Quote
Old Apr 19th, 2006, 6:35 PM   #7
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
Quote:
this has to be a record... 30 minutes with no reply?
Oh yeeeee gadsssssssssssss, forgive us mama! We didn't prepare the bottle or the pacifier in accordance with expectations! S'cuse me while I go decapitate my fingernail with a hedge clipper! Actually, probably 10% of the problems in a program occur unpredictably (that means, not until the boss or client is looking). It's usually the result of undefined or unspecified behavior. There, there's your answer. Gotta go. Oh, "rec - E - I - ve".
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Old Apr 19th, 2006, 10:01 PM   #8
Dameon
Troll
 
Dameon's Avatar
 
Join Date: Apr 2005
Location: Texas
Posts: 732
Rep Power: 4 Dameon is on a distinguished road
Umm...debugger? I think I'll side with the VM on this one...
__________________
MD5(sig) = bcef75433db02e9ad9bf81d6f7c5c270
Dameon is offline   Reply With Quote
Old Apr 20th, 2006, 4:05 AM   #9
Pedja
Programmer
 
Join Date: Nov 2005
Location: Belgrade, Serbia & Montenegro
Posts: 31
Rep Power: 0 Pedja is on a distinguished road
Send a message via ICQ to Pedja Send a message via MSN to Pedja Send a message via Yahoo to Pedja
@nnxion
I think that the problem might be passing a null value to the function.
Pedja is offline   Reply With Quote
Old Apr 20th, 2006, 5:31 AM   #10
nnxion
Programming Guru
 
nnxion's Avatar
 
Join Date: Jun 2005
Location: elemental plane
Posts: 1,429
Rep Power: 5 nnxion is on a distinguished road
Quote:
Originally Posted by Pedja
@nnxion
I think that the problem might be passing a null value to the function.
Nah, I don't think he's that stupid.
Btw: You actually spelled my nick correctly, yay.
__________________
"Employ your time in improving yourself by other men's writings, so that you shall gain easily what others have labored hard for."
-- Socrates
nnxion is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 2:25 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC