![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Expert Programmer
|
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 |
|
|
|
|
|
#2 |
|
Expert Programmer
|
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 |
|
|
|
|
|
#3 |
|
Programming Guru
![]() Join Date: Jun 2005
Location: elemental plane
Posts: 1,429
Rep Power: 5
![]() |
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. |
|
|
|
|
|
#4 |
|
Expert Programmer
Join Date: May 2005
Location: East Lansing, MI
Posts: 663
Rep Power: 4
![]() |
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. |
|
|
|
|
|
#5 |
|
Programmer
|
It seems that at some point pipeVal is passed to the function without having been initialized.
|
|
|
|
|
|
#6 |
|
Programming Guru
![]() Join Date: Jun 2005
Location: elemental plane
Posts: 1,429
Rep Power: 5
![]() |
@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 |
|
|
|
|
|
#7 | |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
Quote:
__________________
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 |
|
|
|
|
|
|
#8 |
|
Troll
Join Date: Apr 2005
Location: Texas
Posts: 732
Rep Power: 4
![]() |
Umm...debugger? I think I'll side with the VM on this one...
__________________
MD5(sig) = bcef75433db02e9ad9bf81d6f7c5c270 |
|
|
|
|
|
#9 |
|
Programmer
|
@nnxion
I think that the problem might be passing a null value to the function. |
|
|
|
|
|
#10 | |
|
Programming Guru
![]() Join Date: Jun 2005
Location: elemental plane
Posts: 1,429
Rep Power: 5
![]() |
Quote:
![]() 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 |
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|