7175704: [macosx] "8" PIT: NPE in GetDisplayMode fullscreen test
authorkizune
Wed, 17 Oct 2012 14:32:15 +0400
changeset 14161 2b346f8e3b8f
parent 14160 249b30c4dea8
child 14162 a78ee9af4a48
7175704: [macosx] "8" PIT: NPE in GetDisplayMode fullscreen test Reviewed-by: serb, leonidr
jdk/src/macosx/classes/sun/awt/CGraphicsDevice.java
--- a/jdk/src/macosx/classes/sun/awt/CGraphicsDevice.java	Tue Oct 16 20:11:19 2012 +0400
+++ b/jdk/src/macosx/classes/sun/awt/CGraphicsDevice.java	Wed Oct 17 14:32:15 2012 +0400
@@ -194,6 +194,9 @@
 
     @Override
     public void setDisplayMode(DisplayMode dm) {
+        if (dm == null) {
+            throw new IllegalArgumentException("Invalid display mode");
+        }
         nativeSetDisplayMode(displayID, dm.getWidth(), dm.getHeight(), dm.getBitDepth(), dm.getRefreshRate());
         if (isFullScreenSupported() && getFullScreenWindow() != null) {
             getFullScreenWindow().setSize(dm.getWidth(), dm.getHeight());