From c6180241d546d3bf13fa1005d319041be6857929 Mon Sep 17 00:00:00 2001 From: Alexander Lobas Date: Tue, 9 Oct 2012 13:25:03 +0400 Subject: [PATCH] EA-38832 --- .../platform-impl/src/com/intellij/ui/AppIcon.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/platform/platform-impl/src/com/intellij/ui/AppIcon.java b/platform/platform-impl/src/com/intellij/ui/AppIcon.java index 9cde623319e2..b37e212ba812 100644 --- a/platform/platform-impl/src/com/intellij/ui/AppIcon.java +++ b/platform/platform-impl/src/com/intellij/ui/AppIcon.java @@ -376,7 +376,7 @@ public abstract class AppIcon { } try { - if (frame != null) { + if (isValid(frame)) { Win7TaskBar.setProgress(frame, value, isOk); } } @@ -396,7 +396,7 @@ public abstract class AppIcon { } try { - if (frame != null) { + if (isValid(frame)) { Win7TaskBar.hideProgress(frame); } } @@ -413,7 +413,7 @@ public abstract class AppIcon { @Override public void _setTextBadge(IdeFrame frame, String text) { - if (frame == null) { + if (!isValid(frame)) { return; } @@ -458,7 +458,7 @@ public abstract class AppIcon { @Override public void _setOkBadge(IdeFrame frame, boolean visible) { - if (frame == null) { + if (!isValid(frame)) { return; } @@ -494,7 +494,7 @@ public abstract class AppIcon { @Override public void _requestAttention(IdeFrame frame, boolean critical) { try { - if (frame != null) { + if (isValid(frame)) { Win7TaskBar.attention(frame, critical); } } @@ -511,6 +511,10 @@ public abstract class AppIcon { @Override public void requestFocus(IdeFrame frame) { } + + private static boolean isValid(IdeFrame frame) { + return frame != null && ((Component)frame).isDisplayable(); + } } private static class EmptyIcon extends AppIcon {