From a2d65d01b9818ea4cccc7f719cc71a6fa818702e Mon Sep 17 00:00:00 2001 From: sirjonasxx <36828922+sirjonasxx@users.noreply.github.com> Date: Fri, 20 Aug 2021 03:52:06 +0200 Subject: [PATCH] fix error when no extensions installed --- .../application/entities/installed/InstalledOverview.java | 5 +++-- .../entities/installed/StoreExtensionInstalledItem.java | 1 - 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/G-Earth/src/main/java/gearth/services/internal_extensions/extensionstore/application/entities/installed/InstalledOverview.java b/G-Earth/src/main/java/gearth/services/internal_extensions/extensionstore/application/entities/installed/InstalledOverview.java index 49a92bc..b64d1c2 100644 --- a/G-Earth/src/main/java/gearth/services/internal_extensions/extensionstore/application/entities/installed/InstalledOverview.java +++ b/G-Earth/src/main/java/gearth/services/internal_extensions/extensionstore/application/entities/installed/InstalledOverview.java @@ -45,6 +45,7 @@ public class InstalledOverview extends HOverview { installed = installed.subList(startIndex, Math.min(startIndex + limit, installed.size())); Map nameToExt = new HashMap<>(); + // getExtensions() with no filtering includes outdated extensions storeRepository.getExtensions().forEach(e -> nameToExt.put(e.getTitle(), e)); return installed.stream().map(i -> new StoreExtensionInstalledItem(nameToExt.get(i.getName()), i)).collect(Collectors.toList()); @@ -59,8 +60,8 @@ public class InstalledOverview extends HOverview { public void buttonClick(GExtensionStore gExtensionStore) { try { Desktop.getDesktop().open(new File(StoreExtensionTools.EXTENSIONS_PATH)); - } catch (IOException e) { - e.printStackTrace(); + } catch (Exception e) { +// e.printStackTrace(); // no extensions installed yet, directory isnt created } } diff --git a/G-Earth/src/main/java/gearth/services/internal_extensions/extensionstore/application/entities/installed/StoreExtensionInstalledItem.java b/G-Earth/src/main/java/gearth/services/internal_extensions/extensionstore/application/entities/installed/StoreExtensionInstalledItem.java index d9c55dd..f5d6cda 100644 --- a/G-Earth/src/main/java/gearth/services/internal_extensions/extensionstore/application/entities/installed/StoreExtensionInstalledItem.java +++ b/G-Earth/src/main/java/gearth/services/internal_extensions/extensionstore/application/entities/installed/StoreExtensionInstalledItem.java @@ -6,7 +6,6 @@ import gearth.services.internal_extensions.extensionstore.application.WebUtils; import gearth.services.internal_extensions.extensionstore.application.entities.StoreExtensionItem; import gearth.services.internal_extensions.extensionstore.repository.models.StoreExtension; import gearth.services.internal_extensions.extensionstore.tools.InstalledExtension; -import netscape.javascript.JSObject; import org.apache.maven.artifact.versioning.ComparableVersion; public class StoreExtensionInstalledItem extends StoreExtensionItem {