Unverified Commit 920fe039 authored by Gautier de Saint Martin Lacaze's avatar Gautier de Saint Martin Lacaze Committed by GitHub
Browse files

Merge pull request #824 from tschwery/fix-nullpointer-setting

Fix NullPointer on invalid settings
parents ee4408af e32ac382
...@@ -1199,9 +1199,14 @@ public enum Setting { ...@@ -1199,9 +1199,14 @@ public enum Setting {
return; return;
} }
StringBuilder shouldBe = new StringBuilder(types[0].getSimpleName()); StringBuilder shouldBe;
for (int i = 1; i < types.length; i++) { if (type != null) {
shouldBe.append(" | ").append(types[i].getSimpleName()); shouldBe = new StringBuilder(type.getSimpleName());
} else {
shouldBe = new StringBuilder(types[0].getSimpleName());
for (int i = 1; i < types.length; i++) {
shouldBe.append(" | ").append(types[i].getSimpleName());
}
} }
String errorMsg = String.format("'%s' value is of incorrect type, is %s, should be %s", String errorMsg = String.format("'%s' value is of incorrect type, is %s, should be %s",
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment