summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDwight <dmerriman@gmail.com>2009-02-09 12:53:04 -0500
committerDwight <dmerriman@gmail.com>2009-02-09 12:53:04 -0500
commit10d5a55c357c9190b85576fc77bee8a71bb4d05e (patch)
tree8de0aa0d1bb1335729c16dccb89670d8c76d7eb1
parenta01b4063b908f91dc64ef3b2e3edef962296f227 (diff)
parent31df4e48b2339255890079f3e446c9c785b27d34 (diff)
downloadmongo-10d5a55c357c9190b85576fc77bee8a71bb4d05e.tar.gz
Merge branch 'master' of git.10gen.com:/data/gitroot/p
-rw-r--r--db/query.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/db/query.cpp b/db/query.cpp
index ee19c77ea55..c3c01795253 100644
--- a/db/query.cpp
+++ b/db/query.cpp
@@ -50,6 +50,8 @@ namespace mongo {
void appendElementHandlingGtLt(BSONObjBuilder& b, BSONElement& e);
int matchDirection( const BSONObj &index, const BSONObj &sort ) {
+ if ( index.isEmpty() || sort.isEmpty() )
+ return 0;
int direction = 0;
BSONObjIterator i( index );
BSONObjIterator s( sort );