Return-Path: Delivered-To: apmail-incubator-ace-commits-archive@minotaur.apache.org Received: (qmail 25638 invoked from network); 3 Oct 2009 21:50:32 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 3 Oct 2009 21:50:32 -0000 Received: (qmail 46989 invoked by uid 500); 3 Oct 2009 21:50:32 -0000 Delivered-To: apmail-incubator-ace-commits-archive@incubator.apache.org Received: (qmail 46971 invoked by uid 500); 3 Oct 2009 21:50:32 -0000 Mailing-List: contact ace-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ace-dev@incubator.apache.org Delivered-To: mailing list ace-commits@incubator.apache.org Received: (qmail 46951 invoked by uid 99); 3 Oct 2009 21:50:32 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 03 Oct 2009 21:50:32 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 03 Oct 2009 21:41:31 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 9229C2388853; Sat, 3 Oct 2009 21:41:10 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r821424 - /incubator/ace/trunk/webui/src/org/apache/ace/client/Main.java Date: Sat, 03 Oct 2009 21:41:10 -0000 To: ace-commits@incubator.apache.org From: angelos@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20091003214110.9229C2388853@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: angelos Date: Sat Oct 3 21:41:10 2009 New Revision: 821424 URL: http://svn.apache.org/viewvc?rev=821424&view=rev Log: ACE-41 Now we don't have a selection per se when creating associations, we introduced the opportunity for an NPE when updating highlights; introduced a null check for that. Modified: incubator/ace/trunk/webui/src/org/apache/ace/client/Main.java Modified: incubator/ace/trunk/webui/src/org/apache/ace/client/Main.java URL: http://svn.apache.org/viewvc/incubator/ace/trunk/webui/src/org/apache/ace/client/Main.java?rev=821424&r1=821423&r2=821424&view=diff ============================================================================== --- incubator/ace/trunk/webui/src/org/apache/ace/client/Main.java (original) +++ incubator/ace/trunk/webui/src/org/apache/ace/client/Main.java Sat Oct 3 21:41:10 2009 @@ -19,6 +19,7 @@ package org.apache.ace.client; import java.util.Arrays; +import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -184,15 +185,22 @@ * Triggers the updating of the highlight */ void updateHighlight() { - m_assocationService.getRelated(getSelectedObject(), new AsyncCallback() { - public void onFailure(Throwable caught) { - // Too bad... - Window.alert("Error updating highlights: " + caught); - } - public void onSuccess(Descriptor[] result) { - highlight(Arrays.asList(result)); - } - }); + Descriptor selected = getSelectedObject(); + if (selected == null) { + List emptyList = Collections.emptyList(); + highlight(emptyList); + } + else { + m_assocationService.getRelated(selected, new AsyncCallback() { + public void onFailure(Throwable caught) { + // Too bad... + Window.alert("Error updating highlights: " + caught); + } + public void onSuccess(Descriptor[] result) { + highlight(Arrays.asList(result)); + } + }); + } } /**