Skip to content

Instance Loader Error zaken

Featured Replies

[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

at instances.CavernOfThePirateCaptain.CavernOfThePirateCaptain.checkConditions(CavernOfThePirateCaptain.java:220)

what have here? 220 line

  • Author

        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

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

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

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.