]> git.mxchange.org Git - jcontacts-core.git/commitdiff
check on user instance
authorRoland Häder <roland@mxchange.org>
Thu, 21 Apr 2016 12:39:22 +0000 (14:39 +0200)
committerRoland Häder <roland@mxchange.org>
Thu, 21 Apr 2016 12:39:22 +0000 (14:39 +0200)
src/org/mxchange/jcontacts/contact/UserContact.java

index 0f4beecfd88c41ccc200288761b989ac9baefdc7..b176ccf1c526581e2a90357a4a5bfab022c292d8 100644 (file)
@@ -248,6 +248,12 @@ public class UserContact implements Contact {
 
        @Override
        public void copyAll (final Contact contact) {
+               // Contact should be valid
+               if (null == contact) {
+                       // Throw NPE
+                       throw new NullPointerException("contact is null"); //NOI18N
+               }
+
                // Copy all:
                // - base data
                this.setContactFirstName(contact.getContactFirstName());