TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Kenneth Wallace
NA
1
0
HELP; system.nullreferenceexeption
Sep 3 2008 11:30 AM
I am receiving the following error:
System.NullReferenceExeption: Object reference no set to an instance of an object. at COServerProject.Client.GetPacket(Byte[] data) in c:\xxx\client.cs:line 7785
Here is the code:
if (Control <= 16 && Control >= 10)
{
string TheEquip = "";
if (Control == 10)
TheEquip = MyChar.Equips[1];
if (Control == 11)
TheEquip = MyChar.Equips[2];
if (Control == 12)
TheEquip = MyChar.Equips[3];
if (Control == 13)
TheEquip = MyChar.Equips[4];
if (Control == 14)
TheEquip = MyChar.Equips[6];
if (Control == 15)
TheEquip = MyChar.Equips[8];
if (Control == 16)
TheEquip = MyChar.Equips[5];
byte Pos = 0;
if (Control == 10)
Pos = 1;
if (Control == 11)
Pos = 2;
if (Control == 12)
Pos = 3;
if (Control == 13)
Pos = 4;
if (Control == 14)
Pos = 6;
if (Control == 15)
Pos = 8;
if (Control == 16)
Pos = 5;
string[] Splitter = TheEquip.Split('-');
uint ItemId = uint.Parse(Splitter[0]);
if (!Other.Upgradable(ItemId))
return;
byte RequiredMets = 0;
if (Other.ItemInfo(ItemId)[3] < 120)
{
RequiredMets = (byte)(Other.ItemInfo(ItemId)[3] / 10);
if (RequiredMets == 0)
RequiredMets = 1;
}
if (RequiredMets != 0)
{
if (Other.ItemQuality(ItemId) < 7)
RequiredMets = 2;
if (Other.ItemQuality(ItemId) == 7)
RequiredMets = (byte)(2 + RequiredMets / 5);
if (Other.ItemQuality(ItemId) == 8)
RequiredMets = (byte)(RequiredMets * 2.6);
if (Other.ItemQuality(ItemId) == 9)
RequiredMets = (byte)(RequiredMets * 3.1);
}
and this is line 7785:
string[] Splitter = TheEquip.Split('-');
Please contact me through MSN or e-mail to help me with this error. Thank you in advance for any help you can give.
Reply
Answers (
0
)
Data Form Wizard icon missing
String Manipulation