-Solved-

Post here your questions about Actionscript and Java server side extensions development.

Moderators: Lapo, Bax

User avatar
coolboy714cp
Posts: 323
Joined: 06 Feb 2010, 02:45
Contact:

-Solved-

Postby coolboy714cp » 14 Jul 2011, 06:11

-Solved-
Last edited by coolboy714cp on 21 Jul 2011, 22:34, edited 1 time in total.
User avatar
rjgtav
Posts: 2813
Joined: 19 Apr 2009, 11:31
Location: Lisbon, Portugal

Postby rjgtav » 14 Jul 2011, 09:40

hi. In what line does the error happen? You can find it by adding a trace(number) in each line - the number starts from 0 and increases by 1 each line - and then check in which line it stops tracing. The error reports that you are trying to set something on a null object.

Maybe its because you do an if(cmd == "getInventory") inside the switch statement, which is not needed, and also because you only instantiate the returnData object inside the if statement. So i suggest you to instantiate the returnData object before the switch.
Skills: SFS Pro, SFS2X, AS2.0/AS3.0, Java, HTML5/CSS3/JS, C#
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.
User avatar
BigFIsh
Posts: 1698
Joined: 25 Feb 2008, 19:26
Location: New Zealand

Postby BigFIsh » 14 Jul 2011, 23:01

You need to perform a check for the size of rows returned:

dbQuery.size() > 0

Otherwise, you'll get that error when you attempt to fetch the first row when it doesn't exist.
Smartfox's forum is my daily newspaper.

Return to “Server Side Extension Development”

Who is online

Users browsing this forum: No registered users and 52 guests