Skip to content

Commit d048698

Browse files
[FSSDK-11150] review update 3
1 parent 5227e6d commit d048698

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

OptimizelySDK/Cmab/DefaultCmabClient.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,12 @@ private static StringContent BuildContent(object payload)
9595

9696
private static CmabRequest BuildRequestBody(string ruleId, string userId, IDictionary<string, object> attributes, string cmabUuid)
9797
{
98-
var attrList = (attributes ?? new Dictionary<string, object>()).Select(kv => new CmabAttribute { Id = kv.Key, Value = kv.Value }).ToList();
98+
var attrList = new List<CmabAttribute>();
99+
100+
if (attributes != null)
101+
{
102+
attrList = attributes.Select(kv => new CmabAttribute { Id = kv.Key, Value = kv.Value }).ToList();
103+
}
99104

100105
return new CmabRequest
101106
{
@@ -151,7 +156,7 @@ private async Task<string> DoFetchOnceAsync(string url, CmabRequest request, Tim
151156
_logger.Log(LogLevel.ERROR, CmabConstants.ErrorInvalidResponse);
152157
throw new CmabInvalidResponseException(ex.Message);
153158
}
154-
catch(CmabInvalidResponseException)
159+
catch (CmabInvalidResponseException)
155160
{
156161
throw;
157162
}

0 commit comments

Comments
 (0)