Fixed probable homunculus slot NPE.

This commit is contained in:
MobiusDevelopment 2021-07-23 23:07:06 +00:00
parent 1572e4f8b9
commit f08143fc8d
3 changed files with 18 additions and 0 deletions

View File

@ -59,6 +59,12 @@ public class RequestExHomunculusEnchantExp implements IClientIncomingPacket
int points = player.getVariables().getInt(PlayerVariables.HOMUNCULUS_UPGRADE_POINTS, 0) - 1;
player.getVariables().set(PlayerVariables.HOMUNCULUS_UPGRADE_POINTS, points);
final Homunculus homunculus = player.getHomunculusList().get(_slot);
if (homunculus == null)
{
player.sendPacket(new ExHomunculusEnchantEXPResult(false, false));
return;
}
homunculus.setExp(homunculus.getExp() + EXP_PER_POINT);
player.sendPacket(new ExHomunculusPointInfo(player));
switch (homunculus.getLevel())

View File

@ -59,6 +59,12 @@ public class RequestExHomunculusEnchantExp implements IClientIncomingPacket
int points = player.getVariables().getInt(PlayerVariables.HOMUNCULUS_UPGRADE_POINTS, 0) - 1;
player.getVariables().set(PlayerVariables.HOMUNCULUS_UPGRADE_POINTS, points);
final Homunculus homunculus = player.getHomunculusList().get(_slot);
if (homunculus == null)
{
player.sendPacket(new ExHomunculusEnchantEXPResult(false, false));
return;
}
homunculus.setExp(homunculus.getExp() + EXP_PER_POINT);
player.sendPacket(new ExHomunculusPointInfo(player));
switch (homunculus.getLevel())

View File

@ -59,6 +59,12 @@ public class RequestExHomunculusEnchantExp implements IClientIncomingPacket
int points = player.getVariables().getInt(PlayerVariables.HOMUNCULUS_UPGRADE_POINTS, 0) - 1;
player.getVariables().set(PlayerVariables.HOMUNCULUS_UPGRADE_POINTS, points);
final Homunculus homunculus = player.getHomunculusList().get(_slot);
if (homunculus == null)
{
player.sendPacket(new ExHomunculusEnchantEXPResult(false, false));
return;
}
homunculus.setExp(homunculus.getExp() + EXP_PER_POINT);
player.sendPacket(new ExHomunculusPointInfo(player));
switch (homunculus.getLevel())