mirror of
https://github.com/xpipe-io/xpipe.git
synced 2024-11-21 23:20:23 +00:00
Fix NPEs for failed stores
This commit is contained in:
parent
a2364d6f47
commit
569e262c97
2 changed files with 15 additions and 0 deletions
|
@ -7,6 +7,7 @@ import io.xpipe.app.fxcomps.SimpleComp;
|
|||
import io.xpipe.app.fxcomps.impl.IconButtonComp;
|
||||
import io.xpipe.app.fxcomps.impl.PrettyImageComp;
|
||||
import io.xpipe.app.fxcomps.util.PlatformThread;
|
||||
import io.xpipe.app.storage.DataStoreEntry;
|
||||
import io.xpipe.app.util.BusyProperty;
|
||||
import io.xpipe.app.util.ThreadHelper;
|
||||
import io.xpipe.core.store.DataStore;
|
||||
|
@ -177,6 +178,15 @@ final class BrowserBookmarkList extends SimpleComp {
|
|||
setAccessibleText(null);
|
||||
} else {
|
||||
setText(item.getName());
|
||||
|
||||
// Check if store is in failed state
|
||||
if (item.getEntry().getState() == DataStoreEntry.State.LOAD_FAILED) {
|
||||
setGraphic(null);
|
||||
setFocusTraversable(false);
|
||||
setAccessibleText(null);
|
||||
return;
|
||||
}
|
||||
|
||||
img.set(item.getEntry()
|
||||
.getProvider()
|
||||
.getDisplayIconFileName(item.getEntry().getStore()));
|
||||
|
|
|
@ -112,6 +112,11 @@ public class DataStoreChoiceComp<T extends DataStore> extends SimpleComp {
|
|||
continue;
|
||||
}
|
||||
|
||||
// Check if load failed
|
||||
if (e.getEntry().getStore() == null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
var node = comboBox.add((T) e.getEntry().getStore());
|
||||
if (!storeClass.isAssignableFrom(s.getClass()) || !applicableCheck.test((T) s)) {
|
||||
comboBox.disable(node);
|
||||
|
|
Loading…
Reference in a new issue