@@ -719,8 +719,10 @@ Optimizely.prototype._getFeatureVariableForType = function(featureKey, variableK
719
719
if ( ! variable ) {
720
720
return null ;
721
721
}
722
-
723
- if ( variableType && variable . type !== variableType ) {
722
+
723
+ if ( ! variableType ) {
724
+ variableType = variable . type ;
725
+ } else if ( variable . type !== variableType ) {
724
726
this . logger . log (
725
727
LOG_LEVEL . WARNING ,
726
728
sprintf ( LOG_MESSAGES . VARIABLE_REQUESTED_WITH_WRONG_TYPE , MODULE_NAME , variableType , variable . type )
@@ -759,7 +761,7 @@ Optimizely.prototype._getFeatureVariableForType = function(featureKey, variableK
759
761
}
760
762
}
761
763
762
- var typeCastedValue = projectConfig . getTypeCastValue ( variableValue , variable . type , this . logger ) ;
764
+ var typeCastedValue = projectConfig . getTypeCastValue ( variableValue , variableType , this . logger ) ;
763
765
this . notificationCenter . sendNotifications (
764
766
NOTIFICATION_TYPES . DECISION ,
765
767
{
@@ -772,7 +774,7 @@ Optimizely.prototype._getFeatureVariableForType = function(featureKey, variableK
772
774
source : decision . decisionSource ,
773
775
variableKey : variableKey ,
774
776
variableValue : typeCastedValue ,
775
- variableType : variable . type ,
777
+ variableType : variableType ,
776
778
sourceInfo : sourceInfo ,
777
779
}
778
780
}
0 commit comments