File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed
core-api/src/main/java/com/optimizely/ab Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -394,7 +394,13 @@ public void track(@Nonnull String eventName,
394394 LiveVariable .VariableType .DOUBLE
395395 );
396396 if (variableValue != null ) {
397- return Double .parseDouble (variableValue );
397+ try {
398+ return Double .parseDouble (variableValue );
399+ }
400+ catch (NumberFormatException exception ) {
401+ logger .error ("NumberFormatException while trying to parse \" " + variableValue +
402+ "\" as Double. " + exception );
403+ }
398404 }
399405 return null ;
400406 }
@@ -434,7 +440,13 @@ public void track(@Nonnull String eventName,
434440 LiveVariable .VariableType .INTEGER
435441 );
436442 if (variableValue != null ) {
437- return Integer .parseInt (variableValue );
443+ try {
444+ return Integer .parseInt (variableValue );
445+ }
446+ catch (NumberFormatException exception ) {
447+ logger .error ("NumberFormatException while trying to parse \" " + variableValue +
448+ "\" as Integer. " + exception .toString ());
449+ }
438450 }
439451 return null ;
440452 }
You can’t perform that action at this time.
0 commit comments