} else if (addressbook.getAddressbookId() < 1) {
// Invalid id number
throw new IllegalArgumentException(MessageFormat.format("addressbook.addressbookId={0} is invalid.", addressbook.getAddressbookId())); //NOI18N
+ } else if (addressbook.getAddressbookUser() == null) {
+ // Throw NPE again
+ throw new NullPointerException("addressbook.addressbookUser is null"); //NOI18N
+ } else if (addressbook.getAddressbookUser().getUserId() == null) {
+ // Throw NPE again
+ throw new NullPointerException("addressbook.addressbookUser.userId is null"); //NOI18N
+ } else if (addressbook.getAddressbookUser().getUserId() < 1) {
+ // Invalid id number
+ throw new IllegalArgumentException(MessageFormat.format("addressbook.addressbookUser.userId={0} is invalid.", addressbook.getAddressbookUser().getUserId())); //NOI18N
} else if (Objects.equals(addressbook.getAddressbookUser(), sharee)) {
// Sharing with yourself!
throw new IllegalStateException("User tries to share with himself."); //NOI18N