Skip to content
Browse files

Handle the obvious "not found" case

  • Loading branch information...
1 parent 9e3204b commit 8ae5ae4c0c9c3b59a6540272067c71f1cc8b7a68 @romanbsd romanbsd committed Feb 18, 2012
Showing with 5 additions and 0 deletions.
  1. +5 −0 rlm_mongo.c
View
5 rlm_mongo.c
@@ -156,6 +156,11 @@ static int find_radius_options(rlm_mongo_t *data, const char *username, const ch
bson_bool_t res = mongo_find_one(conn, data->base, &query, &field, &result);
bson_destroy(&query);
+ if (res != MONGO_OK) {
+ DEBUG("Not found.\n");
+ return 0;
+ }
+
DEBUG("Result:\n");
if (debug_flag) {
bson_print(&result);

0 comments on commit 8ae5ae4

Please sign in to comment.
Something went wrong with that request. Please try again.