From abc14e98efda5cfe30a015423edb935021f36633 Mon Sep 17 00:00:00 2001 From: Cekis Date: Mon, 23 May 2016 15:48:54 +0100 Subject: [PATCH] Fixed null ptr issue when reverse engineering where componenet was invalid. --- .../script/space/crafting/component_loot.java | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) mode change 100644 => 100755 sku.0/sys.server/compiled/game/script/space/crafting/component_loot.java diff --git a/sku.0/sys.server/compiled/game/script/space/crafting/component_loot.java b/sku.0/sys.server/compiled/game/script/space/crafting/component_loot.java old mode 100644 new mode 100755 index 9ecc4d2e4..74d19ef7f --- a/sku.0/sys.server/compiled/game/script/space/crafting/component_loot.java +++ b/sku.0/sys.server/compiled/game/script/space/crafting/component_loot.java @@ -1,16 +1,8 @@ package script.space.crafting; -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - import script.library.space_crafting; -import script.library.space_utils; import script.library.utils; +import script.obj_id; public class component_loot extends script.base_script { @@ -30,9 +22,12 @@ public class component_loot extends script.base_script } public int OnGetAttributes(obj_id self, obj_id player, String[] names, String[] attribs) throws InterruptedException { + if(self == null || self == obj_id.NULL_ID || !isIdValid(self)){ + return SCRIPT_CONTINUE; + } int flags = getIntObjVar(self, "ship_comp.flags"); boolean isBitSet = (flags & ship_component_flags.SCF_reverse_engineered) != 0; - if (isBitSet == true) + if (isBitSet) { int idx = utils.getValidAttributeIndex(names); if (idx == -1)