harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apavle...@apache.org
Subject svn commit: r601632 - /harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/gl/windows/WinGDIPGraphics2D.java
Date Thu, 06 Dec 2007 07:03:22 GMT
Author: apavlenko
Date: Wed Dec  5 23:03:19 2007
New Revision: 601632

URL: http://svn.apache.org/viewvc?rev=601632&view=rev
Log:
The method WinGDIPGraphics2D.getDeviceConfiguration() causes NPE if the current Graphics is
associated neither with a window nor with an image.

Modified:
    harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/gl/windows/WinGDIPGraphics2D.java

Modified: harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/gl/windows/WinGDIPGraphics2D.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/gl/windows/WinGDIPGraphics2D.java?rev=601632&r1=601631&r2=601632&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/gl/windows/WinGDIPGraphics2D.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/gl/windows/WinGDIPGraphics2D.java
Wed Dec  5 23:03:19 2007
@@ -212,10 +212,11 @@
     @Override
     public GraphicsConfiguration getDeviceConfiguration() {
         if (config == null) {
-            if (img == null) {
+            if (nw != null) {
                 config = new WinGraphicsConfiguration(nw.getId(), getDC());
-            } else {
-                long hwnd = img.getHWND();
+            } else if (img != null) {
+                final long hwnd = img.getHWND();
+                
                 if(hwnd != 0){
                     config = new WinGraphicsConfiguration(hwnd, getDC());
                 }else{



Mime
View raw message