-
Type: Bug
-
Resolution: Won't Fix
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
Labels:None
in BsonWriter the if statement is missing an else and thus always falls through to the last else which tries to cast the timespan into a long
case BsonType.Long:
if(obj is TimeSpan)
_writer.Write(((TimeSpan)obj).Ticks);
if (obj is DateTime)
Write((DateTime)obj);
else
_writer.Write((long)obj);
return;
should be
case BsonType.Long:
if(obj is TimeSpan)
_writer.Write(((TimeSpan)obj).Ticks);
else if (obj is DateTime)
Write((DateTime)obj);
else
_writer.Write((long)obj);
return;