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 @@ -431,7 +431,13 @@ public void track(@Nonnull String eventName,
431431 LiveVariable .VariableType .DOUBLE
432432 );
433433 if (variableValue != null ) {
434- return Double .parseDouble (variableValue );
434+ try {
435+ return Double .parseDouble (variableValue );
436+ }
437+ catch (NumberFormatException exception ) {
438+ logger .error ("NumberFormatException while trying to parse \" " + variableValue +
439+ "\" as Double. " + exception );
440+ }
435441 }
436442 return null ;
437443 }
@@ -471,7 +477,13 @@ public void track(@Nonnull String eventName,
471477 LiveVariable .VariableType .INTEGER
472478 );
473479 if (variableValue != null ) {
474- return Integer .parseInt (variableValue );
480+ try {
481+ return Integer .parseInt (variableValue );
482+ }
483+ catch (NumberFormatException exception ) {
484+ logger .error ("NumberFormatException while trying to parse \" " + variableValue +
485+ "\" as Integer. " + exception .toString ());
486+ }
475487 }
476488 return null ;
477489 }
You can’t perform that action at this time.
0 commit comments