summaryrefslogtreecommitdiff
path: root/s/d_migrate.cpp
diff options
context:
space:
mode:
Diffstat (limited to 's/d_migrate.cpp')
-rw-r--r--s/d_migrate.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/s/d_migrate.cpp b/s/d_migrate.cpp
index 918dd86a44f..a0ccdd8df4d 100644
--- a/s/d_migrate.cpp
+++ b/s/d_migrate.cpp
@@ -507,7 +507,8 @@ namespace mongo {
// use the builder size instead of accumulating 'o's size so that we take into consideration
// the overhead of BSONArray indices
- if ( a.len() + o.objsize() + 1024 > BSONObjMaxUserSize ) {
+ if ( a.arrSize() != 0 &&
+ a.len() + o.objsize() + 1024 > BSONObjMaxUserSize ) {
filledBuffer = true; // break out of outer while loop
break;
}