Null check the locations.yml Map before changing into a CaseInsensitiveMap (Fixes #920)

This commit is contained in:
Thinkofdeath 2014-03-10 19:34:11 +00:00
parent 2a7ad3c2b2
commit 5beafed279

View File

@ -35,7 +35,11 @@ public class YamlReconnectHandler extends AbstractReconnectHandler
file.createNewFile(); file.createNewFile();
try ( FileReader rd = new FileReader( file ) ) try ( FileReader rd = new FileReader( file ) )
{ {
data = new CaseInsensitiveMap<>( yaml.loadAs( rd, Map.class ) ); Map map = yaml.loadAs( rd, Map.class );
if ( map != null )
{
data = new CaseInsensitiveMap<>( map );
}
} }
} catch ( YAMLException ex ) } catch ( YAMLException ex )
{ {