WANG 6 жил өмнө
parent
commit
f2446fcfa3

+ 6 - 4
examcloud-core-basic-api-provider/src/main/java/cn/com/qmth/examcloud/core/basic/api/controller/StudentController.java

@@ -113,10 +113,12 @@ public class StudentController extends ControllerSupport {
 			}
 			if (null != hasPhoto) {
 				Boolean hasPhotoBoolean = hasPhoto.getBoolean();
-				if (hasPhotoBoolean) {
-					predicates.add(cb.isNotEmpty(root.get("photoPath")));
-				} else {
-					predicates.add(cb.isEmpty(root.get("photoPath")));
+				if (null != hasPhotoBoolean) {
+					if (hasPhotoBoolean) {
+						predicates.add(cb.isNotNull(root.get("photoPath")));
+					} else {
+						predicates.add(cb.isNull(root.get("photoPath")));
+					}
 				}
 			}
 			return cb.and(predicates.toArray(new Predicate[predicates.size()]));