--- old/src/java.desktop/share/classes/sun/awt/image/OffScreenImageSource.java 2016-07-05 16:53:13.627801235 +0530 +++ new/src/java.desktop/share/classes/sun/awt/image/OffScreenImageSource.java 2016-07-05 16:53:13.259801235 +0530 @@ -187,17 +187,19 @@ sendPixels(); theConsumer.imageComplete(ImageConsumer.SINGLEFRAMEDONE); - try { - theConsumer.imageComplete(ImageConsumer.STATICIMAGEDONE); - } catch (RuntimeException e) { - // We did not previously call this method here and - // some image consumer filters were not prepared for it to be - // called at this time. We allow them to have runtime issues - // for this one call only without triggering the IMAGEERROR - // condition below. - e.printStackTrace(); + // If 'theconsumer' has not unregistered itself after previous call + if (theConsumer != null) { + try { + theConsumer.imageComplete(ImageConsumer.STATICIMAGEDONE); + } catch (RuntimeException e) { + // We did not previously call this method here and + // some image consumer filters were not prepared for it to be + // called at this time. We allow them to have runtime issues + // for this one call only without triggering the IMAGEERROR + // condition below. + e.printStackTrace(); + } } - } catch (NullPointerException e) { e.printStackTrace();