Fixed an issue where object creation with an IFF file that doesn't exist would cause holocore to not boot

This commit is contained in:
Mads Boddum
2016-04-12 08:54:55 +02:00
parent 96ab44a0e3
commit b4b88769d0
2 changed files with 7 additions and 3 deletions
+3 -1
View File
@@ -75,7 +75,9 @@ public final class ObjectCreator {
if (!template.endsWith(".iff"))
return null;
ObjectData attributes = (ObjectData) ClientFactory.getInfoFromFile(ClientFactory.formatToSharedFile(template), true);
GameObjectType type = GameObjectType.getTypeFromId((Integer) attributes.getAttribute(ObjectDataAttribute.GAME_OBJECT_TYPE));
if(attributes == null)
return null;
GameObjectType type = GameObjectType.getTypeFromId((Integer) attributes.getAttribute(ObjectDataAttribute.GAME_OBJECT_TYPE));
SWGObject obj = createObjectFromType(objectId, template, type);
if (obj == null)
return null;