DBObject.isEmpty throws NullPointerException

6 views
Skip to first unread message

Allan Brighton

unread,
Jul 28, 2015, 10:03:21 AM7/28/15
to mongodb-casbah-users
Hi,

I updated to the latest 2.8.2 casbah version, but still get a NullPointerException calling isEmpty when the query doesn't find anything:

      val result = db(collName).find(MongoDBObject(subsystemKey -> subsystem, targetKey -> target)).sort(idKey -> -1).one()
      if (result.isEmpty) ... // throws NullPointerException if empty

Is that a bug or am I doing something wrong?


Reply all
Reply to author
Forward
0 new messages