Fixed NullPointerException case on Table init with relative file path.

Can occur for example when running dbtest with relative test table file
name (wihout explicit parent folder).
pull/167/head
luccioman 7 years ago
parent 28883d8a71
commit 6cd3847d0a

@ -110,7 +110,9 @@ public class Table implements Index, Iterable<Row.Entry> {
// make new file // make new file
freshFile = true; freshFile = true;
FileOutputStream fos = null; FileOutputStream fos = null;
if(tablefile.getParentFile() != null) {
tablefile.getParentFile().mkdirs(); tablefile.getParentFile().mkdirs();
}
try { try {
fos = new FileOutputStream(tablefile); fos = new FileOutputStream(tablefile);
} catch (final FileNotFoundException e) { } catch (final FileNotFoundException e) {

Loading…
Cancel
Save