Skip to content

Commit

Permalink
Fix configuration NPE
Browse files Browse the repository at this point in the history
  • Loading branch information
games647 committed Jan 9, 2016
1 parent 23c7680 commit abc8c89
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<packaging>jar</packaging>

<name>HealthName</name>
<version>0.2</version>
<version>0.2.1</version>
<description>Sponge plugin that displays the health of a mob or player above their head</description>
<url>https://github.com/games647/HealthName</url>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class Config {
private boolean belowNameHealth = true;

@Setting(comment = "What character should be used to display the health")
private char displayChar = '|';
private String displayChar = "|";

public boolean isEnabledMob() {
return enabledMob;
Expand All @@ -31,6 +31,6 @@ public boolean isBelowNameHealth() {
}

public char getDisplayChar() {
return displayChar;
return displayChar.charAt(0);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import java.io.File;
import java.io.IOException;

import ninja.leaping.configurate.ConfigurationOptions;
import ninja.leaping.configurate.commented.CommentedConfigurationNode;
import ninja.leaping.configurate.loader.ConfigurationLoader;
import ninja.leaping.configurate.objectmapping.ObjectMapper;
Expand Down Expand Up @@ -39,14 +38,13 @@ public void load() {
if (!defaultConfigFile.exists()) {
try {
defaultConfigFile.createNewFile();
rootNode = configManager.createEmptyNode(ConfigurationOptions.defaults());
} catch (IOException ioExc) {
plugin.getLogger().error("Error creating a new config file", ioExc);
return;
}
}

rootNode = configManager.createEmptyNode(ConfigurationOptions.defaults());
rootNode = configManager.createEmptyNode();
if (configMapper != null) {
try {
rootNode = configManager.load();
Expand Down

0 comments on commit abc8c89

Please sign in to comment.