fix error when no extensions installed

This commit is contained in:
sirjonasxx 2021-08-20 03:52:06 +02:00
parent 16a014b96d
commit a2d65d01b9
2 changed files with 3 additions and 3 deletions

View File

@ -45,6 +45,7 @@ public class InstalledOverview extends HOverview {
installed = installed.subList(startIndex, Math.min(startIndex + limit, installed.size()));
Map<String, StoreExtension> 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
}
}

View File

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