Check for null variables, fixes #1052

This commit is contained in:
PikaMug 2020-01-28 23:40:10 -05:00
parent 56555dcab8
commit c6bbff9bab
2 changed files with 4 additions and 1 deletions

View File

@ -1186,6 +1186,9 @@ public class Quester {
* @return true if quest contains specified objective * @return true if quest contains specified objective
*/ */
public boolean containsObjective(Quest quest, String s) { public boolean containsObjective(Quest quest, String s) {
if (quest == null) {
return false;
}
return getCurrentStage(quest).containsObjective(s); return getCurrentStage(quest).containsObjective(s);
} }

View File

@ -61,7 +61,7 @@ public class NpcEffectThread implements Runnable {
* @param effectType Value of EnumParticle such as NOTE or SMOKE * @param effectType Value of EnumParticle such as NOTE or SMOKE
*/ */
public void showEffect(Player player, NPC npc, String effectType) { public void showEffect(Player player, NPC npc, String effectType) {
if (player == null || npc == null) { if (player == null || npc == null || npc.getEntity() == null) {
return; return;
} }
if (plugin.getDependencies().getCitizens() != null) { if (plugin.getDependencies().getCitizens() != null) {