mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-14 19:55:52 -07:00
Fixed blank yaml config files throwing a null pointer exception
By: stevenh <steven.hartland@multiplay.co.uk>
This commit is contained in:
@@ -115,7 +115,11 @@ public class Configuration extends ConfigurationNode {
|
|||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
private void read(Object input) throws ConfigurationException {
|
private void read(Object input) throws ConfigurationException {
|
||||||
try {
|
try {
|
||||||
|
if ( null == input ) {
|
||||||
|
root = new HashMap<String, Object>();
|
||||||
|
} else {
|
||||||
root = (Map<String, Object>)input;
|
root = (Map<String, Object>)input;
|
||||||
|
}
|
||||||
} catch (ClassCastException e) {
|
} catch (ClassCastException e) {
|
||||||
throw new ConfigurationException("Root document must be an key-value structure");
|
throw new ConfigurationException("Root document must be an key-value structure");
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user