[gnome-logs] Make find mode tolerant of NULL event messages



commit e2e9690b09ea37a6e1ea142868f573bc0e3be915
Author: David King <davidk gnome org>
Date:   Thu Oct 24 15:04:16 2013 +0100

    Make find mode tolerant of NULL event messages

 src/gl-eventview.c |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/src/gl-eventview.c b/src/gl-eventview.c
index e65f728..3c0b856 100644
--- a/src/gl-eventview.c
+++ b/src/gl-eventview.c
@@ -77,10 +77,13 @@ listbox_search_filter_func (GtkListBoxRow *row,
 
         result = gl_journal_query_cursor (priv->journal, cursor);
 
-        if (strstr (result->comm, priv->search_text)
-            || strstr (result->message, priv->search_text)
-            || strstr (result->kernel_device, priv->search_text)
-            || strstr (result->audit_session, priv->search_text))
+        if ((result->comm ? strstr (result->comm, priv->search_text) : NULL)
+            || (result->message ? strstr (result->message, priv->search_text)
+                                : NULL)
+            || (result->kernel_device ? strstr (result->kernel_device,
+                                                priv->search_text) : NULL)
+            || (result->audit_session ? strstr (result->audit_session,
+                                                priv->search_text) : NULL))
         {
             gl_journal_result_free (priv->journal, result);
 


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