Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 79150 invoked from network); 6 Dec 2007 07:03:54 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 6 Dec 2007 07:03:54 -0000 Received: (qmail 58657 invoked by uid 500); 6 Dec 2007 07:03:42 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 58626 invoked by uid 500); 6 Dec 2007 07:03:42 -0000 Mailing-List: contact commits-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list commits@harmony.apache.org Received: (qmail 58617 invoked by uid 99); 6 Dec 2007 07:03:42 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Dec 2007 23:03:42 -0800 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Dec 2007 07:03:44 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 02B3B1A9832; Wed, 5 Dec 2007 23:03:22 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: commits@harmony.apache.org From: apavlenko@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20071206070323.02B3B1A9832@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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{