I'm working on a simple chat (http://sourceforge.net/projects/chattered/) and I'm adding functionality (SQLLite user DB for remember logged user) and I want to make the logout process for the user (switch user) and when I fire the LogoutEvent I get a NPE. This is my output:
You can go through my code on sourceforge, particulary this file [1] I launch the event on line 699 and receive the result on dispatch method (line 150), first thing I do is log the Event fired and I can't even get that when I launch LogoutEvent. Do you know how to solve this?
I'm getting a similar problem but at the Actionscript end. When the Logout Event is received I get the following output in Flash:
[SFS - INFO] Logout { Message id: 2 }
{ Dump: }
(utf_string) zn: GameZone
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at com.smartfoxserver.v2::SmartFox/handleLogout()[/Users/Lapo/Documents/Flex Builder 3/SFS2X_AS3_API/src/com/smartfoxserver/v2/SmartFox.as:1912]
at com.smartfoxserver.v2.controllers::SystemController/fnLogout()[/Users/Lapo/Documents/Flex Builder 3/SFS2X_AS3_API/src/com/smartfoxserver/v2/controllers/SystemController.as:827]
at com.smartfoxserver.v2.controllers::SystemController/handleMessage()[/Users/Lapo/Documents/Flex Builder 3/SFS2X_AS3_API/src/com/smartfoxserver/v2/controllers/SystemController.as:127]
at com.smartfoxserver.v2.core::SFSProtocolCodec/dispatchRequest()[/Users/Lapo/Documents/Flex Builder 3/SFS2X_AS3_API/src/com/smartfoxserver/v2/core/SFSProtocolCodec.as:150]
at com.smartfoxserver.v2.core::SFSProtocolCodec/onPacketRead()[/Users/Lapo/Documents/Flex Builder 3/SFS2X_AS3_API/src/com/smartfoxserver/v2/core/SFSProtocolCodec.as:54]
at com.smartfoxserver.v2.core::SFSIOHandler/handlePacketData()[/Users/Lapo/Documents/Flex Builder 3/SFS2X_AS3_API/src/com/smartfoxserver/v2/core/SFSIOHandler.as:246]
at com.smartfoxserver.v2.core::SFSIOHandler/onDataRead()[/Users/Lapo/Documents/Flex Builder 3/SFS2X_AS3_API/src/com/smartfoxserver/v2/core/SFSIOHandler.as:105]
at com.smartfoxserver.v2.bitswarm::BitSwarmClient/onSocketData()[/Users/Lapo/Documents/Flex Builder 3/SFS2X_AS3_API/src/com/smartfoxserver/v2/bitswarm/BitSwarmClient.as:419]
I've just patched, but the swc file doesn't seem to have updated. Any ideas?
Lapo wrote:Hi, I am not able to reproduce the problem. Are you sure you are using the latest API available, version 1.0.1?
Thanks
I see that the timestamp of that version is 03/05/2012 and I start working with SFS for Android about a couple of months so I think I have that version but I'm not sure, is there a way to check this?
Thanks
Terribly sorry, I just did a search for similar errors and hadn't realised which forum I was in. It seems these would have the same root cause. Any way, I have created a new thread in the Actionscript forum. http://forums.smartfoxserver.com/viewto ... 19&t=15188