EA-89520 - NPE: SwingHelper.adjustDialogSizeToFitPreferredSize
[idea/community.git] / platform / platform-impl / src / com / intellij / util / ui / SwingHelper.java
index 3200bf9f471cdad6a6aa5e00aa7559c346014d90..617fce5e27810c0ef48ad0aa46b5fc2f4f188a93 100644 (file)
@@ -192,6 +192,7 @@ public class SwingHelper {
 
   public static void adjustDialogSizeToFitPreferredSize(@NotNull DialogWrapper dialogWrapper) {
     JRootPane rootPane = dialogWrapper.getRootPane();
+    if (rootPane == null) return;
     Dimension componentSize = rootPane.getSize();
     Dimension componentPreferredSize = rootPane.getPreferredSize();
     if (componentPreferredSize.width <= componentSize.width && componentPreferredSize.height <= componentSize.height) {