From e5de873ccf6c431635c1a46ee04bd3ed5d18e6b2 Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Mon, 12 Oct 2015 17:40:33 +0200 Subject: [PATCH] Compare against null --- .../org/mxchange/addressbook/beans/user/UserWebBean.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/java/org/mxchange/addressbook/beans/user/UserWebBean.java b/src/java/org/mxchange/addressbook/beans/user/UserWebBean.java index 0ff385cc..c9467c04 100644 --- a/src/java/org/mxchange/addressbook/beans/user/UserWebBean.java +++ b/src/java/org/mxchange/addressbook/beans/user/UserWebBean.java @@ -328,7 +328,7 @@ public class UserWebBean implements UserWebController { contact.setContactEmailAddress(this.getEmailAddress()); // Don't set null or wrong references - if ((phone instanceof DialableLandLineNumber) && (phone.getPhoneCountry() instanceof Country) && (this.getPhoneAreaCode() > 0) &&(this.getPhoneNumber() > 0)) { + if ((phone instanceof DialableLandLineNumber) && (phone.getPhoneCountry() instanceof Country) && (this.getPhoneAreaCode() != null) && (this.getPhoneNumber() != null) && (this.getPhoneAreaCode() > 0) &&(this.getPhoneNumber() > 0)) { // Now the number must be given if (phone.getPhoneAreaCode() == null) { // Is null @@ -349,7 +349,7 @@ public class UserWebBean implements UserWebController { } // Don't set null or wrong references - if ((fax instanceof DialableFaxNumber) && (fax.getPhoneCountry() instanceof Country) && (this.getFaxAreaCode() > 0) && (this.getFaxNumber() > 0)) { + if ((fax instanceof DialableFaxNumber) && (fax.getPhoneCountry() instanceof Country) && (this.getFaxAreaCode() != null) && (this.getFaxNumber() != null) && (this.getFaxAreaCode() > 0) && (this.getFaxNumber() > 0)) { // Now the number must be given if (fax.getPhoneAreaCode() == null) { // Is null @@ -370,7 +370,7 @@ public class UserWebBean implements UserWebController { } // Is the provider set? - if ((cellphone instanceof DialableCellphoneNumber) && (this.getCellphoneCarrier() instanceof SmsProvider) && (this.getCellphoneNumber() > 0)) { + if ((cellphone instanceof DialableCellphoneNumber) && (this.getCellphoneCarrier() instanceof SmsProvider) && (this.getCellphoneNumber() != null) && (this.getCellphoneNumber() > 0)) { // Is the number set? if (cellphone.getPhoneNumber() == null) { // Is null -- 2.39.5