cache: prevent dumping enums with no data
This commit is contained in:
@@ -36,6 +36,11 @@ public class EnumLoader
|
||||
|
||||
public EnumDefinition load(int id, byte[] b)
|
||||
{
|
||||
if (b.length == 1 && b[0] == 0)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
EnumDefinition def = new EnumDefinition();
|
||||
InputStream is = new InputStream(b);
|
||||
|
||||
|
||||
@@ -78,8 +78,11 @@ public class EnumDumperTest
|
||||
|
||||
EnumDefinition def = loader.load(file.getFileId(), b);
|
||||
|
||||
Files.write(gson.toJson(def), new File(dumpDir, file.getFileId() + ".json"), Charset.defaultCharset());
|
||||
++count;
|
||||
if (def != null)
|
||||
{
|
||||
Files.write(gson.toJson(def), new File(dumpDir, file.getFileId() + ".json"), Charset.defaultCharset());
|
||||
++count;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user