]> git.mxchange.org Git - jjobs-war.git/blobdiff - src/java/org/mxchange/jjobs/validator/user/JobsUserIdValidator.java
Please cherry-pick:
[jjobs-war.git] / src / java / org / mxchange / jjobs / validator / user / JobsUserIdValidator.java
index b416b0e8e59627e0749b56daf8390dda47447db2..267a071f0c2311ad7bc04de6ea78e1f17117fcd1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016, 2017 Roland Häder
+ * Copyright (C) 2016 - 2018 Free Software Foundation
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -47,18 +47,18 @@ public class JobsUserIdValidator extends BaseNumberValidator {
 
        @Override
        public void validate (final FacesContext context, final UIComponent component, final Object value) throws ValidatorException {
-               // Is the instance there?
-               if (USER_CONTROLLER == null) {
-                       // Get bean from CDI directly
-                       USER_CONTROLLER = CDI.current().select(JobsUserWebRequestBean.class).get();
-               }
-
                // All accepted, required fields
                final String[] requiredFields = {"userId"}; //NOI18N
 
                // Pre-validation (example: not null, not a string, empty string ...)
                super.preValidate(context, component, value, requiredFields, false);
 
+               // Is the instance there?
+               if (null == USER_CONTROLLER) {
+                       // Get bean from CDI directly
+                       USER_CONTROLLER = CDI.current().select(JobsUserWebRequestBean.class).get();
+               }
+
                // Cast value
                final Long userId = (Long) value;