Skip to content

Commit

Permalink
Don't load UUID if there's no UUID to load
Browse files Browse the repository at this point in the history
  • Loading branch information
fullwall committed Jan 12, 2014
1 parent 77e3a4f commit af6f05b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main/java/net/citizensnpcs/api/npc/AbstractNPC.java
Expand Up @@ -284,7 +284,9 @@ public boolean isSpawned() {
@Override
public void load(final DataKey root) {
metadata.loadFrom(root.getRelative("metadata"));
uuid = UUID.fromString(root.getString("uuid"));
if (root.keyExists("uuid")) {
uuid = UUID.fromString(root.getString("uuid"));
}

String traitNames = root.getString("traitnames");
Set<DataKey> keys = Sets.newHashSet(root.getRelative("traits").getSubKeys());
Expand Down

0 comments on commit af6f05b

Please sign in to comment.