]> git.mxchange.org Git - addressbook-war.git/commitdiff
Please cherry-pick:
authorRoland Häder <roland@mxchange.org>
Sat, 21 Jan 2023 09:02:55 +0000 (10:02 +0100)
committerRoland Häder <roland@mxchange.org>
Sat, 21 Jan 2023 09:04:46 +0000 (10:04 +0100)
- "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

src/java/org/mxchange/addressbook/beans/contact/list/AddressbookContactListWebViewBean.java

index d3bc433855f24bef9228b300ddd0b5c70768e534..1c95619b49e40cf398c136c8d4c7a0f42714a2a9 100644 (file)
@@ -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;