paperbox r190 - in trunk: . src



Author: markoa
Date: Mon Sep 29 16:56:05 2008
New Revision: 190
URL: http://svn.gnome.org/viewvc/paperbox?rev=190&view=rev

Log:
Guard against possibly null document

Modified:
   trunk/ChangeLog
   trunk/src/browser.cc

Modified: trunk/src/browser.cc
==============================================================================
--- trunk/src/browser.cc	(original)
+++ trunk/src/browser.cc	Mon Sep 29 16:56:05 2008
@@ -118,7 +118,7 @@
             // or trackerd is (re)indexing and being unresponsive.
             LOG_DD("Cancelling document retrieval from tracker - "
                    << "is it (re)indexing? "
-                   << "Try running PaperBox again after a minute.");
+                   << "Try running Paperbox again after a minute.");
             return false; // idle function done
         }
 
@@ -129,19 +129,19 @@
             shared_ptr<Document> doc;
             tracker_client_->get_document(uri, doc);
 
-            docs_[uri.raw()] = doc;
-            signal_new_document_.emit(doc);
+            if (doc.get()) {
+                docs_[uri.raw()] = doc;
+                signal_new_document_.emit(doc);
+            }
         }
         catch (const Glib::FileError& ex) {
+            // probably a nonexistent file in the index
             LOG_EXCEPTION(uri << ": " << ex.what());
         }
 
         uri_queue_.pop();
 
-        if (uri_queue_.empty())
-            return false; // done
-        else
-            return true;
+        return (uri_queue_.empty()) ? false /* done with all */ : true;
     }
 
     Browser::SignalNewDocument&



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]