null object reference problem

Post here your questions about the OpenSpace 2.x or notify bugs and suggestions.

Moderators: Lapo, Bax

dannyrg
Posts: 19
Joined: 19 Oct 2010, 19:08

null object reference problem

Postby dannyrg » 15 Nov 2010, 06:00

Hi,

I'm getting a
TypeError: Error #1009: Cannot access a property or method of a null object reference.
when using tile.getTopSkin();
now, I know that in some occasions I am trying to get skins of a tile that does not contain any, but I don't get why I should get an error instead of just an "answer" such as a null result, to indicate that a skin was not found on the tile?
Why would I get an error instead of a simple "null" answer which I can check for with a simple "if" statement?

since I know I will get asked why I am trying to get the skin of a tile that doesn't have any, the answer is simple, I want to go over ALL the tiles and IF they have a skin, I want to make that skin do something (go to a frame or whatever).
The only other way, would be to actually parse the map together with the .lib file and figure out which tile contains what and so on and I do not want to have to do that.
User avatar
Bax
Site Admin
Posts: 4612
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Postby Bax » 17 Nov 2010, 08:37

You are right, this is a bug. It will be solved in the upcoming 2.0.3 version.
Paolo Bax
The SmartFoxServer Team

Return to “OpenSpace v2 discussions and help”

Who is online

Users browsing this forum: No registered users and 23 guests