mirror of
https://github.com/xpipe-io/xpipe.git
synced 2026-04-25 00:52:31 -04:00
Fix NPEs for failed stores
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user