From commits-return-13482-apmail-sis-commits-archive=sis.apache.org@sis.apache.org Mon Apr 20 16:23:12 2020 Return-Path: X-Original-To: apmail-sis-commits-archive@www.apache.org Delivered-To: apmail-sis-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by minotaur.apache.org (Postfix) with SMTP id 2413D19AB8 for ; Mon, 20 Apr 2020 16:23:11 +0000 (UTC) Received: (qmail 88067 invoked by uid 500); 20 Apr 2020 16:23:11 -0000 Delivered-To: apmail-sis-commits-archive@sis.apache.org Received: (qmail 88050 invoked by uid 500); 20 Apr 2020 16:23:11 -0000 Mailing-List: contact commits-help@sis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: sis-dev@sis.apache.org Delivered-To: mailing list commits@sis.apache.org Received: (qmail 88040 invoked by uid 99); 20 Apr 2020 16:23:11 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 20 Apr 2020 16:23:11 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id D9F5F8B6C7; Mon, 20 Apr 2020 16:23:10 +0000 (UTC) Date: Mon, 20 Apr 2020 16:23:10 +0000 To: "commits@sis.apache.org" Subject: [sis] branch geoapi-4.0 updated: Fix a NullPointerException. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Message-ID: <158739979083.31337.13706511831373471939@gitbox.apache.org> From: desruisseaux@apache.org X-Git-Host: gitbox.apache.org X-Git-Repo: sis X-Git-Refname: refs/heads/geoapi-4.0 X-Git-Reftype: branch X-Git-Oldrev: b0cf8d53cfd20866d60d4b2e044d1a4c2bdbd321 X-Git-Newrev: 1a3bceee5f3db4ffc38f8e55e1fbe0ab4a1a5bcd X-Git-Rev: 1a3bceee5f3db4ffc38f8e55e1fbe0ab4a1a5bcd X-Git-NotificationType: ref_changed_plus_diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated This is an automated email from the ASF dual-hosted git repository. desruisseaux pushed a commit to branch geoapi-4.0 in repository https://gitbox.apache.org/repos/asf/sis.git The following commit(s) were added to refs/heads/geoapi-4.0 by this push: new 1a3bcee Fix a NullPointerException. 1a3bcee is described below commit 1a3bceee5f3db4ffc38f8e55e1fbe0ab4a1a5bcd Author: Martin Desruisseaux AuthorDate: Mon Apr 20 18:22:51 2020 +0200 Fix a NullPointerException. --- .../java/org/apache/sis/gui/referencing/CRSChooser.java | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/application/sis-javafx/src/main/java/org/apache/sis/gui/referencing/CRSChooser.java b/application/sis-javafx/src/main/java/org/apache/sis/gui/referencing/CRSChooser.java index f2c427d..603722b 100644 --- a/application/sis-javafx/src/main/java/org/apache/sis/gui/referencing/CRSChooser.java +++ b/application/sis-javafx/src/main/java/org/apache/sis/gui/referencing/CRSChooser.java @@ -300,6 +300,10 @@ public class CRSChooser extends Dialog { * the {@link #type} and {@link #domain} fields with CRS information. */ private void updateSummary(final Code selected) { + if (selected == null) { + clearSummary(); + return; + } final AuthorityCodes source = getAuthorityCodes(); final String code = selected.code; BackgroundThreads.execute(new Task() { @@ -318,8 +322,7 @@ public class CRSChooser extends Dialog { /** Invoked in JavaFX thread on cancellation. */ @Override protected void cancelled() { - type.setText(null); - domain.setText(null); + clearSummary(); } /** Invoked in JavaFX thread on failure. */ @@ -332,6 +335,14 @@ public class CRSChooser extends Dialog { } /** + * Clears the {@link #type} and {@link #domain} fields. + */ + private void clearSummary() { + type.setText(null); + domain.setText(null); + } + + /** * Sets the text that describes the domain of validity. */ private void setDomainOfValidity(final Extent domainOfValidity, final Locale locale) {