Click here to Skip to main content
15,890,557 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
I have card game , and I am working on it and sometimes I get stumbled, but after awhile I figure out what the problem is, but in this case I am just helpless.

I have to post the link to my file, otherwise the code will be too long, because there's a lot of different classes.

This is is the link

http://www.4shared.com/rar/AQvIkAQr/LetItRide.html?refurl=d1url[^]

What you have to do to get the error is click Start button, then click 25-500 bet range button, and then click on any chip button and after that click Deal button, and that's when you should get the exception.
Posted
Comments
Sergey Alexandrovich Kryukov 23-Feb-12 22:52pm    
This is the easiest exception to find out the problem. Just run it under Debugger. If something is not clear, ask more specific question.
--SA

you may be using some variable in your code which is null and its not handled properly means the null exception handling. Do debugging and check. Thess links will be helpful to you:-

http://www.csharp-station.com/Tutorials/lesson15.aspx[^]

http://msdn.microsoft.com/en-us/library/ms173163.aspx[^]

44,500,000 results on null exception handling c#
 
Share this answer
 
v2
NullReferenceException can happen when you call a method on a null variable. For example:

C#
string s = null;
if (s.equals(...)) // NullReferenceException is thrown here
...


In the example, you have called equals method in a string variable, but the variable actually doesn't point to any object. It's null.

As SAKryukov has wrote in his comment, just debug it, go step by step, and find out which variable is set to null.

See the stack-trace to identify the point which the exception is thrown. Then you will have to check just few lines around that point.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900