]> git.mxchange.org Git - pizzaservice-mailer-ejb.git/blobdiff - src/java/org/mxchange/jcontacts/contact/LandingAdminContactSessionBean.java
Fixed: (please cherry-pick)
[pizzaservice-mailer-ejb.git] / src / java / org / mxchange / jcontacts / contact / LandingAdminContactSessionBean.java
index dbbe9f15ddaf63c99acb50067ae55c354fb0a32b..1137f0e2850ff5af4832008eea265380f611c128 100644 (file)
@@ -83,9 +83,12 @@ public class LandingAdminContactSessionBean extends BaseLandingDatabaseBean impl
                if (null == contact) {
                        // Throw NPE
                        throw new NullPointerException("contact is null"); //NOI18N
-               } else if (contact.getContactId() != null) {
-                       // Should be null
-                       throw new IllegalArgumentException(MessageFormat.format("contact.contactId={0} - is not null", contact.getContactId())); //NOI18N
+               } else if (contact.getContactId() == null) {
+                       // Should not be null
+                       throw new NullPointerException("contact.contactId is null"); //NOI18N
+               } else if (contact.getContactId() < 1) {
+                       // Not valid
+                       throw new IllegalArgumentException(MessageFormat.format("contact.contactId={0} is not valid", contact.getContactId())); //NOI18N
                }
 
                // Merge it to get a managed entity back
@@ -95,7 +98,7 @@ public class LandingAdminContactSessionBean extends BaseLandingDatabaseBean impl
                this.getEntityManager().remove(managedContact);
 
                // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.deleteContactData: EXIT!", this.getClass().getSimpleName()));
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.deleteContactData: EXIT!", this.getClass().getSimpleName())); //NOI18N
        }
 
 }