]> git.mxchange.org Git - jfinancials-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:02:55 +0000 (10:02 +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/jfinancials/beans/contact/list/FinancialsContactListWebViewBean.java

index f0dba3c9a4a8a3447bd1f84d496cbbd82397eff3..45e7cba8d95c215e8f91b80811c46bcf0fa481fc 100644 (file)
@@ -511,6 +511,12 @@ public class FinancialsContactListWebViewBean extends BaseFinancialsBean impleme
 
        @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;