check file format

This commit is contained in:
Jesse Boyd 2018-04-14 02:52:41 +10:00
parent 5bdc2d6519
commit 049aff4d74
No known key found for this signature in database
GPG Key ID: 59F1DE6293AF6E1F

View File

@ -332,6 +332,7 @@ public class SchemVis extends ImmutableVirtualWorld {
cached.createNewFile();
try (FileInputStream in = new FileInputStream(file)) {
ClipboardFormat format = ClipboardFormat.findByFile(file);
if (format != null) {
ClipboardReader reader = format.getReader(in);
Clipboard clipboard = reader.read(worldData);
clipboard.setOrigin(clipboard.getMinimumPoint());
@ -377,6 +378,7 @@ public class SchemVis extends ImmutableVirtualWorld {
}
}
}
}
} catch (Throwable e) {
e.printStackTrace();
cached.delete();