Fix NPE at MongoDB type signature guessing
When a field value is null or contains null, there's no way to guess its type.
@@ -505,6 +505,10 @@ public class MongoSession
private Optional<TypeSignature> guessFieldType(Object value)
{
+ if (value == null) {
+ return Optional.empty();
+ }
+
TypeSignature typeSignature = null;
if (value instanceof String) {
typeSignature = createUnboundedVarcharType().getTypeSignature();
