equip list npe fix
Some checks failed
studiorailgun/Renderer/pipeline/head There was a failure building this commit
Some checks failed
studiorailgun/Renderer/pipeline/head There was a failure building this commit
This commit is contained in:
parent
d4f8cbf9df
commit
c09faed7a7
@ -678,7 +678,7 @@ Include jenkins dockerfile in repo
|
||||
Better model for gameobjects
|
||||
Server synchronization of sprint tree
|
||||
Fix potential bad path for item state lookup
|
||||
Fix ItemUtils NPE bug
|
||||
Fix multiple ItemUtils NPE bugs
|
||||
Fix AttachUtils NPE bug
|
||||
|
||||
|
||||
|
||||
@ -344,7 +344,15 @@ public class ItemUtils {
|
||||
return item.containsKey(EntityDataStrings.ITEM_IS_ARMOR);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the entity has an equip list
|
||||
* @param item The item entity
|
||||
* @return true if it has an equip list, false otherwise
|
||||
*/
|
||||
public static boolean hasEquipList(Entity item){
|
||||
if(item == null){
|
||||
return false;
|
||||
}
|
||||
return item.containsKey(EntityDataStrings.ITEM_EQUIP_WHITELIST);
|
||||
}
|
||||
|
||||
|
||||
@ -17,4 +17,11 @@ public class ItemUtilsUnitTests {
|
||||
Assertions.assertEquals(false, result);
|
||||
}
|
||||
|
||||
@UnitTest
|
||||
@FastTest
|
||||
public void hasEquipList_NullEntity_False(){
|
||||
boolean result = ItemUtils.hasEquipList(null);
|
||||
Assertions.assertEquals(false, result);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user