diff options
author | Dwight <dmerriman@gmail.com> | 2009-02-09 12:53:04 -0500 |
---|---|---|
committer | Dwight <dmerriman@gmail.com> | 2009-02-09 12:53:04 -0500 |
commit | 10d5a55c357c9190b85576fc77bee8a71bb4d05e (patch) | |
tree | 8de0aa0d1bb1335729c16dccb89670d8c76d7eb1 | |
parent | a01b4063b908f91dc64ef3b2e3edef962296f227 (diff) | |
parent | 31df4e48b2339255890079f3e446c9c785b27d34 (diff) | |
download | mongo-10d5a55c357c9190b85576fc77bee8a71bb4d05e.tar.gz |
Merge branch 'master' of git.10gen.com:/data/gitroot/p
-rw-r--r-- | db/query.cpp | 2 |
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 ); |