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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..