[gnome-games/wip/exalm/null] tracker-uri-iterator: Skip null uris



commit dc93310e06bab779be6f26a944c2f8ad927637fc
Author: Alexander Mikhaylenko <exalm7659 gmail com>
Date:   Sat Dec 1 18:48:22 2018 +0500

    tracker-uri-iterator: Skip null uris
    
    Sometimes, sparql query can return null URIs, causing a crash later. Add a
    check to skip those uris.
    
    Fixes #106

 src/tracker/tracker-uri-iterator.vala | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
---
diff --git a/src/tracker/tracker-uri-iterator.vala b/src/tracker/tracker-uri-iterator.vala
index f04130db..218ec7b8 100644
--- a/src/tracker/tracker-uri-iterator.vala
+++ b/src/tracker/tracker-uri-iterator.vala
@@ -54,7 +54,11 @@ private class Games.TrackerUriIterator : Object, UriIterator {
                if (!cursor.next ())
                        return false;
 
-               uri = new Uri (cursor.get_string (0));
+               var uri_string = cursor.get_string (0);
+               if (uri_string != null)
+                       return false;
+
+               uri = new Uri (uri_string);
 
                return true;
        }


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