summaryrefslogtreecommitdiff
path: root/mongoexport/csv.go
diff options
context:
space:
mode:
authorKyle Erf <erf@mongodb.com>2015-09-21 16:25:36 -0400
committerKyle Erf <erf@mongodb.com>2015-09-25 13:16:00 -0400
commit0ef415c20840862dc75756b0886701045a885143 (patch)
treeae2def6f82e503676957d046119aaf8a8df45a25 /mongoexport/csv.go
parente48ac15af23cdaf0dc45754801019d16cc820881 (diff)
downloadmongo-0ef415c20840862dc75756b0886701045a885143.tar.gz
TOOLS-916 dont attempt to dive into a nil document
Diffstat (limited to 'mongoexport/csv.go')
-rw-r--r--mongoexport/csv.go3
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 {