EA-83882 - NPE: InstalledPackagesPanel.buildNameToPackageMap
authorSergey Simonchik <sergey.simonchik@jetbrains.com>
Tue, 21 Jun 2016 18:03:54 +0000 (21:03 +0300)
committerSergey Simonchik <sergey.simonchik@jetbrains.com>
Tue, 21 Jun 2016 18:03:54 +0000 (21:03 +0300)
platform/lang-impl/src/com/intellij/webcore/packaging/InstalledPackagesPanel.java

index 469f196365a4968e9c4e7c9aa70ffa9002850160..7d4f19a392c49616c9817a9374724238d46f8018 100644 (file)
@@ -520,7 +520,19 @@ public class InstalledPackagesPanel extends JPanel {
     });
   }
 
-  private static Map<String, RepoPackage> buildNameToPackageMap(List<RepoPackage> packages) {
+  private Map<String, RepoPackage> buildNameToPackageMap(List<RepoPackage> packages) {
+    try {
+      return doBuildNameToPackageMap(packages);
+    }
+    catch (Exception e) {
+      PackageManagementService service = myPackageManagementService;
+      LOG.error("Failure in " + getClass().getName() +
+                ", service: " + (service != null ? service.getClass().getName() : null), e);
+      return Collections.emptyMap();
+    }
+  }
+
+  private static Map<String, RepoPackage> doBuildNameToPackageMap(List<RepoPackage> packages) {
     final Map<String, RepoPackage> packageMap = new HashMap<String, RepoPackage>();
     for (RepoPackage aPackage : packages) {
       packageMap.put(aPackage.getName(), aPackage);