diff options
author | Kyle Erf <erf@mongodb.com> | 2015-09-21 16:25:36 -0400 |
---|---|---|
committer | Kyle Erf <erf@mongodb.com> | 2015-09-25 13:16:00 -0400 |
commit | 0ef415c20840862dc75756b0886701045a885143 (patch) | |
tree | ae2def6f82e503676957d046119aaf8a8df45a25 /mongoexport/csv.go | |
parent | e48ac15af23cdaf0dc45754801019d16cc820881 (diff) | |
download | mongo-0ef415c20840862dc75756b0886701045a885143.tar.gz |
TOOLS-916 dont attempt to dive into a nil document
Diffstat (limited to 'mongoexport/csv.go')
-rw-r--r-- | mongoexport/csv.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/mongoexport/csv.go b/mongoexport/csv.go index 8ead2ffdd9a..40934acc53c 100644 --- a/mongoexport/csv.go +++ b/mongoexport/csv.go @@ -96,6 +96,9 @@ func extractFieldByName(fieldName string, document interface{}) interface{} { for _, path := range dotParts { docValue := reflect.ValueOf(subdoc) + if !docValue.IsValid() { + return "" + } docType := docValue.Type() docKind := docType.Kind() if docKind == reflect.Map { |