Skip to content

Commit

Permalink
Potentially fix rare script loading error
Browse files Browse the repository at this point in the history
This should be unneeded, but with SnakeYAML, ...
  • Loading branch information
mcmonkey4eva committed Oct 11, 2014
1 parent deeb413 commit 3b4148c
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,14 @@ private static void patchNonsense(Map<String, Object> objs) {
}
}

private static List<String> patchListNonsense(List<Object> objs) {
List<String> list = new ArrayList<String>();
for (Object o: objs) {
list.add(o.toString());
}
return list;
}

public Set<String> getKeys(boolean deep) {
if (!deep) {
return new HashSet<String>(contents.keySet());
Expand Down Expand Up @@ -157,7 +165,9 @@ public List<String> getStringList(String path) {
Object o = get(path);
if (o == null)
return null;
return (List<String>)o;
if (!(o instanceof List))
return null;
return patchListNonsense((List<Object>) o);
}

public YamlConfiguration getConfigurationSection(String path) {
Expand Down

0 comments on commit 3b4148c

Please sign in to comment.