Fix segfault in case of the database lock not being available.
authorCarl Worth <cworth@cworth.org>
Wed, 28 Oct 2009 06:57:37 +0000 (23:57 -0700)
committerCarl Worth <cworth@cworth.org>
Wed, 28 Oct 2009 06:57:37 +0000 (23:57 -0700)
We were nicely reporting the lock-aquisition failure, but then marching
along trying to use the database object and just crashing badly.
So don't do that.

database.cc

index 5555b0e317083b5ca5f68f65f5050530e6780cb4..71246eb456115ade91ee9b47b89629850ab32e11 100644 (file)
@@ -489,6 +489,7 @@ notmuch_database_open (const char *path)
     } catch (const Xapian::Error &error) {
        fprintf (stderr, "A Xapian exception occurred: %s\n",
                 error.get_msg().c_str());
+       notmuch = NULL;
     }
     
   DONE: