Skip to content

Commit 57c1ccd

Browse files
Revert "refactor: less movement of code as the ref implementation"
This reverts commit dfe1367.
1 parent dfe1367 commit 57c1ccd

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

OptimizelySDK/Bucketing/DecisionService.cs

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ public bool DecisionBatchInProgress
5656
{
5757
SaveToUserProfileService();
5858
}
59-
6059
_decisionBatchInProgress = value;
6160
}
6261
}
@@ -169,13 +168,6 @@ OptimizelyDecideOption[] options
169168
UserProfileUtil.IsValidUserProfileMap(userProfileMap))
170169
{
171170
_userProfile = UserProfileUtil.ConvertMapToUserProfile(userProfileMap);
172-
decisionVariationResult =
173-
GetStoredVariation(experiment, _userProfile, config);
174-
reasons += decisionVariationResult.DecisionReasons;
175-
if (decisionVariationResult.ResultObject != null)
176-
{
177-
return decisionVariationResult.SetReasons(reasons);
178-
}
179171
}
180172
else if (userProfileMap == null)
181173
{
@@ -189,6 +181,17 @@ OptimizelyDecideOption[] options
189181
reasons.AddInfo("The UserProfileService returned an invalid map."));
190182
}
191183
}
184+
185+
if (_userProfile != null)
186+
{
187+
decisionVariationResult =
188+
GetStoredVariation(experiment, _userProfile, config);
189+
reasons += decisionVariationResult.DecisionReasons;
190+
if (decisionVariationResult.ResultObject != null)
191+
{
192+
return decisionVariationResult.SetReasons(reasons);
193+
}
194+
}
192195
}
193196
catch (Exception exception)
194197
{

0 commit comments

Comments
 (0)