Occasionally get the following error:
10:00:17.669 [script.javaScript.exception.unexpectedType]: ***** JavaScript exception (buoyRepair 1.3.1): TypeError: player.ship.dockedStation is null
10:00:17.669 [script.javaScript.exception.unexpectedType]: ../AddOns/BuoyRepair1.3.1.oxp/Scripts/buoyRepair.js, line 73.
Any suggestions as to why the condition should return null rather than docked?
line 73 is: if(player.ship.dockedStation.hasRole("repaired-buoy-station"))
player.ship.dockedStation is null error
Moderators: winston, another_commander
- Commander McLane
- ---- E L I T E ----
- Posts: 9520
- Joined: Thu Dec 14, 2006 9:08 am
- Location: a Hacker Outpost in a moderately remote area
- Contact:
Re: player.ship.dockedStation is null error
The error occurs when this line is executed while you're no longer docked anymore. Therefore there is no station you are docked at, and that means
Some
null
.Some
if
-clause has to be re-written or added to the script in order to avoid this scenario.Re: player.ship.dockedStation is null error
OK, thanks
- Commander McLane
- ---- E L I T E ----
- Posts: 9520
- Joined: Thu Dec 14, 2006 9:08 am
- Location: a Hacker Outpost in a moderately remote area
- Contact:
Re: player.ship.dockedStation is null error
Sorry, I was a little brain-dead there. Of course it's not "some" if-clause, but the one from line 73 you're quoting. Changing it toCommander McLane wrote:Someif
-clause has to be re-written or added to the script in order to avoid this scenario.
Code: Select all
if(player.ship.isDocked && player.ship.dockedStation.hasRole("repaired-buoy-station"))
- Eric Walch
- Slightly Grand Rear Admiral
- Posts: 5536
- Joined: Sat Jun 16, 2007 3:48 pm
- Location: Netherlands
Re: player.ship.dockedStation is null error
I am a bit puzzled. The whole code of buoyRepair.js does not contain above line. Not in the current version 1.3.2 nor in an old version 1.2.5. "repaired-buoy-station" is the role of the station, but there is nowhere in the code a need to check if the player has docked at such a station.DGill wrote:Occasionally get the following error:
10:00:17.669 [script.javaScript.exception.unexpectedType]: ***** JavaScript exception (buoyRepair 1.3.1): TypeError: player.ship.dockedStation is null
10:00:17.669 [script.javaScript.exception.unexpectedType]: ../AddOns/BuoyRepair1.3.1.oxp/Scripts/buoyRepair.js, line 73.
Any suggestions as to why the condition should return null rather than docked?
line 73 is: if(player.ship.dockedStation.hasRole("repaired-buoy-station"))
The only check for a docked player is:
Code: Select all
if (player.ship.docked)
{
this.buoyStatusTimer.stop();
}
UPS-Courier & DeepSpacePirates & others at the box and some older versions
Re: player.ship.dockedStation is null error
Ok, I'll get vrs 1.3.2 from Wiki and re-install
thanks
thanks