From 6cd3847d0acc2a1b75b1948d6b5b6795d797908c Mon Sep 17 00:00:00 2001 From: luccioman Date: Mon, 29 Jan 2018 14:00:43 +0100 Subject: [PATCH] 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). --- source/net/yacy/kelondro/table/Table.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/net/yacy/kelondro/table/Table.java b/source/net/yacy/kelondro/table/Table.java index afa753350..a9d811913 100644 --- a/source/net/yacy/kelondro/table/Table.java +++ b/source/net/yacy/kelondro/table/Table.java @@ -110,7 +110,9 @@ public class Table implements Index, Iterable { // make new file freshFile = true; FileOutputStream fos = null; - tablefile.getParentFile().mkdirs(); + if(tablefile.getParentFile() != null) { + tablefile.getParentFile().mkdirs(); + } try { fos = new FileOutputStream(tablefile); } catch (final FileNotFoundException e) {