weiwenhai 7 жил өмнө
parent
commit
cb2483ec61

+ 7 - 3
examcloud-core-questions-base/src/main/java/cn/com/qmth/examcloud/core/questions/base/CommonUtils.java

@@ -738,9 +738,13 @@ public final class CommonUtils {
      */
     public static boolean isInteger(String str) {  
     	Boolean strResult = str.matches("-?[0-9]+.?[0-9]*");  
-		if(strResult && Double.parseDouble(str)>0) {
-			return true;
-		}
+    	try{
+    		if(strResult && Double.parseDouble(str)>0) {
+    			return true;
+    		}
+    	}catch(NumberFormatException ex){
+    		return false;
+    	}
 		return false;
     }
 }