Cleanup (avoid unneeded NPE)
authorRoman Shevchenko <roman.shevchenko@jetbrains.com>
Mon, 15 Dec 2014 17:15:13 +0000 (18:15 +0100)
committerRoman Shevchenko <roman.shevchenko@jetbrains.com>
Mon, 15 Dec 2014 18:52:53 +0000 (19:52 +0100)
platform/platform-impl/src/com/intellij/ide/plugins/RatesPanel.java

index 18e5b1c79f112f7bafa04738332db3f2f867e870..01582cbd87f4eed832a861a0ee20f7a1a87d1328 100644 (file)
@@ -52,9 +52,12 @@ public class RatesPanel extends JPanel {
 
   public void setRate(String rating) {
     Double dblRating = 0d;
-    try {
-      dblRating = Double.valueOf(rating);
-    } catch (Exception ignore) {}
+    if (rating != null) {
+      try {
+        dblRating = Double.valueOf(rating);
+      }
+      catch (NumberFormatException ignore) { }
+    }
 
     final int intRating = dblRating.intValue();