fix file detection

This commit is contained in:
Eyck Jentzsch 2020-03-29 16:10:36 +02:00
parent 2aa4160400
commit 270a004037
4 changed files with 4 additions and 1 deletions

View File

@ -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);

View File

@ -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 {

View File

@ -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();

View File

@ -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);
}
}