Skip to content

Commit bad1ce6

Browse files
author
rstam
committed
Changed CombineSerializationInfo to only check for null because "" is a valid (though not recommended) element name.
1 parent 2282ab5 commit bad1ce6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Driver/Linq/Utils/BsonSerializationInfoFinder.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -286,16 +286,16 @@ private BsonSerializationInfo VisitElementAt(MethodCallExpression node)
286286

287287
private static BsonSerializationInfo CombineSerializationInfo(BsonSerializationInfo baseInfo, BsonSerializationInfo newInfo)
288288
{
289-
string elementName = string.Empty;
290-
if (!string.IsNullOrEmpty(baseInfo.ElementName) && !string.IsNullOrEmpty(newInfo.ElementName))
289+
string elementName = null;
290+
if (baseInfo.ElementName != null && newInfo.ElementName != null)
291291
{
292292
elementName = baseInfo.ElementName + "." + newInfo.ElementName;
293293
}
294-
else if (!string.IsNullOrEmpty(baseInfo.ElementName))
294+
else if (baseInfo.ElementName != null)
295295
{
296296
elementName = baseInfo.ElementName;
297297
}
298-
else if (!string.IsNullOrEmpty(newInfo.ElementName))
298+
else if (newInfo.ElementName != null)
299299
{
300300
elementName = newInfo.ElementName;
301301
}

0 commit comments

Comments
 (0)