Fixed situation caused when crafting weapons that an error would be thrown in the logs because the crafting component was consumed and no longer existed.

This commit is contained in:
Cekis
2016-05-25 23:25:39 +01:00
parent 04e4cee6bb
commit b2cee2f7af
@@ -27,9 +27,11 @@ public class crafting_weapon_component_attribute extends script.base_script
}
public int OnGetAttributes(obj_id self, obj_id player, String[] names, String[] attribs) throws InterruptedException
{
if (isIdValid(self) && exists(self) && hasObjVar(self, "forceComponent") && !isJedi(player) && !isGod(player))
{
return SCRIPT_OVERRIDE;
if(!isIdValid(self) || !exists(self) || self == null || self == obj_id.NULL_ID){
return SCRIPT_CONTINUE;
}
if (isIdValid(self) && exists(self) && hasObjVar(self, "forceComponent") && !isJedi(player) && !isGod(player)){
return SCRIPT_CONTINUE;
}
int idx = utils.getValidAttributeIndex(names);
if (idx == -1)