Jump to content
  • 0

Instance Loader Error zaken


Question

Posted
[21:28:25] ERROR: /root/game/data/scripts/handlers/InstanceLoader.java 
java.lang.NullPointerException
	at instances.CavernOfThePirateCaptain.CavernOfThePirateCaptain.checkConditions(CavernOfThePirateCaptain.java:220)
	at instances.AbstractInstance.enterInstance(AbstractInstance.java:76)
	at instances.CavernOfThePirateCaptain.CavernOfThePirateCaptain.onAdvEvent(CavernOfThePirateCaptain.java:290)
	at l2r.gameserver.model.quest.Quest.notifyEvent(Quest.java:550)
	at l2r.gameserver.model.actor.instance.L2PcInstance.processQuestEvent(L2PcInstance.java:1544)
	at handlers.bypasshandlers.QuestLink.useBypass(QuestLink.java:76)
	at l2r.gameserver.network.clientpackets.RequestBypassToServer.runImpl(RequestBypassToServer.java:296)
	at l2r.gameserver.network.clientpackets.L2GameClientPacket.run(L2GameClientPacket.java:73)
	at l2r.gameserver.network.L2GameClient.run(L2GameClient.java:1124)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
[21:28:25] ERROR: CavernOfThePirateCaptain: java.lang.NullPointerException
	at instances.CavernOfThePirateCaptain.CavernOfThePirateCaptain.checkConditions(CavernOfThePirateCaptain.java:220)
	at instances.AbstractInstance.enterInstance(AbstractInstance.java:76)
	at instances.CavernOfThePirateCaptain.CavernOfThePirateCaptain.onAdvEvent(CavernOfThePirateCaptain.java:290)
	at l2r.gameserver.model.quest.Quest.notifyEvent(Quest.java:550)
	at l2r.gameserver.model.actor.instance.L2PcInstance.processQuestEvent(L2PcInstance.java:1544)
	at handlers.bypasshandlers.QuestLink.useBypass(QuestLink.java:76)
	at l2r.gameserver.network.clientpackets.RequestBypassToServer.runImpl(RequestBypassToServer.java:296)
	at l2r.gameserver.network.clientpackets.L2GameClientPacket.run(L2GameClientPacket.java:73)
	at l2r.gameserver.network.L2GameClient.run(L2GameClient.java:1124)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)

 

i cant find whats is wrong can some one help me?

 

using high five files l2j

4 answers to this question

Recommended Posts

  • 0
Posted (edited)

        final boolean is83 = InstanceManager.getInstance().getPlayerWorld(player).getTemplateId() == TEMPLATE_ID_83 ? true : false;

 

and whant can by wrong whith this line? i need to chose true or false?

Edited by kreis
  • 0
Posted (edited)

seems like it needs rework... what instance is the object 'player' ?  what arguments getPlayerWorld method have? also you have edit this line to:

final boolean is83 = InstanceManager.getInstance().getPlayerWorld(player).getTemplateId() == TEMPLATE_ID_83;

Its boolean logic.

 

It could be even in getTemplateId() ... try this one

boolean is83 = false;
if (InstanceManager.getInstance().getPlayerWorld(player)!= null)
{
	if (InstanceManager.getInstance().getPlayerWorld(player).getTemplateId() != null) // if getTemplateId() returns int then replace the null check with > 0
		is83 =InstanceManager.getInstance().getPlayerWorld(player).getTemplateId()  == TEMPLATE_ID_83;
	else
		System.out.println("template Id == null");
}
else
	System.out.println("get player == null");

 

And check your console 

Edited by melron
  • 0
Posted (edited)

getPlayerWorld(player) probably returns null, yup. You miss a null check for this one. getTemplateId() can't be null, at worst it's 0 if it's an int.

boolean is83 = false;
final WhateverInstance type = InstanceManager.getInstance().getPlayerWorld(player);
if (type != null)
      is83 = type.getTemplateId() == TEMPLATE_ID_83; 

PS : if the whatever stuff is null at this point, then probably you got an issue way higher (or the type should be checked way higher). Except if it's a normal behavior to get a null here (check other uses).

Edited by Tryskell

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...