Help Please AutoSave Char

10/26/2008 17:14 rigoberto12r#1
Please tell me can solve this problem as when people play off the server and it takes away everything everything returns to atra help plz
System.NullReferenceException: Object reference not set to an instance of an object.
COServer_Project.Character.GetEquipStats at (Pos Byte, Boolean UnEquip)
at COServer_Project.Character.SendEquips (Boolean GetStats)
at COServer_Project.Client.GetPacket (Byte [] data)
at COServer_Project.General.GamePacketHandler (Object Sender, HybridSocket Socket)
10/26/2008 22:57 taguro#2
This is a very common error and the cause is that a variable is used in code, but that variable doesn't contain a reference to any object in memory. If you try to call .ToString() on an object, and your variable is null, you'll get this exception. Sometimes it can be hard to figure out what's going on, but if you look at your stack trace, you can find out what method this Exception came from. Then, debug through that method and find the offending variable. Likely causes are methods that take arguments but don't validate them. If you accept an object as an argument, and you need the "Name" property from the object, you'll get this exception if "null" was passed in instead of a valid object instance. Obviously, the error begins at Character.GetEquipStats, so this would be a good place to start debugging to determine the error. If you don't know how to debug something, click [Only registered and activated users can see links. Click Here To Register...] to learn all about it.