From 0b0e92e9da9120cbfff4f92d36c2d5dad9833574 Mon Sep 17 00:00:00 2001 From: crschnick Date: Tue, 12 Mar 2024 15:27:30 +0000 Subject: [PATCH] Make store creation more resilient when parent is deleted --- .../java/io/xpipe/app/comp/store/StoreCreationComp.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/io/xpipe/app/comp/store/StoreCreationComp.java b/app/src/main/java/io/xpipe/app/comp/store/StoreCreationComp.java index 8c06a3824..e656db08e 100644 --- a/app/src/main/java/io/xpipe/app/comp/store/StoreCreationComp.java +++ b/app/src/main/java/io/xpipe/app/comp/store/StoreCreationComp.java @@ -115,7 +115,7 @@ public class StoreCreationComp extends DialogComp { DataStorage.get().getSelectedCategory().getUuid(), name.getValue(), store.getValue()); - var p = provider.getValue().getDisplayParent(testE); + var p = DataStorage.get().getDefaultDisplayParent(testE).orElse(null); var targetCategory = p != null ? p.getCategoryUuid() @@ -271,6 +271,11 @@ public class StoreCreationComp extends DialogComp { } ThreadHelper.runAsync(() -> { + // Might have changed since last time + if (entry.getValue() == null) { + return; + } + try (var b = new BooleanScope(busy).start()) { DataStorage.get().addStoreEntryInProgress(entry.getValue()); entry.getValue().validateOrThrow();