Ignore the idnamecache.json if empty. Fixes #139. Fixes #130.

This commit is contained in:
Olof Larsson 2014-11-21 09:23:41 +01:00
parent 284debd11c
commit ccd470dc6e

View File

@ -848,7 +848,11 @@ public class IdUtil implements Listener, Runnable
synchronized (CACHEFILE_LOCK)
{
String content = DiscUtil.readCatch(CACHEFILE);
if (content == null) return new HashSet<IdData>();
content = content.trim();
if (content.length() == 0) return new HashSet<IdData>();
Set<IdData> ret = MassiveCore.gson.fromJson(content, CACHEFILE_TYPE);
return ret;
}