]> git.mxchange.org Git - jjobs-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:42 +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/jjobs/beans/contact/list/JobsContactListWebViewBean.java

index 76db636a1afd3cc683641a4c1fb01293e73a906c..2b957712e77eb02afea5fee9a2ff6f11ff943ac2 100644 (file)
@@ -511,6 +511,12 @@ public class JobsContactListWebViewBean extends BaseJobsBean implements JobsCont
 
        @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;