From: Roland Häder Date: Sat, 21 Jan 2023 09:02:55 +0000 (+0100) Subject: Please cherry-pick: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=c4b08d502761a95893a4a84db9030e907be507b8;p=addressbook-war.git Please cherry-pick: - "validate" parameter, e.g. where you don't want null references, then check if it is null to prevent possible logic errors and maybe here a wrong/misleading result --- diff --git a/src/java/org/mxchange/addressbook/beans/contact/list/AddressbookContactListWebViewBean.java b/src/java/org/mxchange/addressbook/beans/contact/list/AddressbookContactListWebViewBean.java index d3bc4338..1c95619b 100644 --- a/src/java/org/mxchange/addressbook/beans/contact/list/AddressbookContactListWebViewBean.java +++ b/src/java/org/mxchange/addressbook/beans/contact/list/AddressbookContactListWebViewBean.java @@ -511,6 +511,12 @@ public class AddressbookContactListWebViewBean extends BaseAddressbookBean imple @Override public boolean isContactFound (final Contact contact) { + // Validate parameter + if (null == contact) { + // Throw NPE + throw new NullPointerException("Parameter 'contact' is null"); //NOI18N + } + // Default is not found boolean IsFound = false;