diff --git a/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/SQLiteDbLoader.java b/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/SQLiteDbLoader.java index d677b73..d90f686 100644 --- a/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/SQLiteDbLoader.java +++ b/com.minres.scviewer.database.sqlite/src/com/minres/scviewer/database/sqlite/SQLiteDbLoader.java @@ -81,6 +81,7 @@ public class SQLiteDbLoader implements IWaveformDbLoader { @Override public boolean load(IWaveformDb db, File file) throws Exception { + if(file.isDirectory() || !file.exists()) return false; this.db=db; try { FileInputStream fis = new FileInputStream(file); diff --git a/com.minres.scviewer.database.text/src/com/minres/scviewer/database/text/TextDbLoader.groovy b/com.minres.scviewer.database.text/src/com/minres/scviewer/database/text/TextDbLoader.groovy index 3979c91..2ae1676 100644 --- a/com.minres.scviewer.database.text/src/com/minres/scviewer/database/text/TextDbLoader.groovy +++ b/com.minres.scviewer.database.text/src/com/minres/scviewer/database/text/TextDbLoader.groovy @@ -64,6 +64,7 @@ public class TextDbLoader implements IWaveformDbLoader{ @Override boolean load(IWaveformDb db, File file) throws Exception { + if(file.isDirectory() || !file.exists()) return false; this.db=db this.streams=[] try { diff --git a/com.minres.scviewer.database.vcd/src/com/minres/scviewer/database/vcd/VCDDbLoader.java b/com.minres.scviewer.database.vcd/src/com/minres/scviewer/database/vcd/VCDDbLoader.java index bde1c9b..a0f12db 100644 --- a/com.minres.scviewer.database.vcd/src/com/minres/scviewer/database/vcd/VCDDbLoader.java +++ b/com.minres.scviewer.database.vcd/src/com/minres/scviewer/database/vcd/VCDDbLoader.java @@ -79,6 +79,7 @@ public class VCDDbLoader implements IWaveformDbLoader, IVCDDatabaseBuilder { @SuppressWarnings("unchecked") @Override public boolean load(IWaveformDb db, File file) throws Exception { + if(file.isDirectory() || !file.exists()) return false; this.db=db; this.maxTime=0; String name = file.getCanonicalFile().getName(); diff --git a/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/parts/WaveformViewer.java b/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/parts/WaveformViewer.java index 9952cdb..aea6b89 100644 --- a/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/parts/WaveformViewer.java +++ b/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/parts/WaveformViewer.java @@ -669,7 +669,7 @@ public class WaveformViewer implements IFileChangeListener, IPreferenceChangeLis } if (filesToLoad.size() > 0) loadDatabase(persistedState); - if(partConfig instanceof String) { + if(partConfig instanceof String && ((String)partConfig).length()>0) { loadState((String) partConfig); } }