[rygel] core: Check if ArrayList is empty



commit 2a904bcbeb62ed0e57f6907dea19d57320e1b415
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Sun Sep 20 01:10:19 2009 +0300

    core: Check if ArrayList is empty
    
    Check if ArrayList is empty before trying to fetch it's elements.

 src/rygel/rygel-media-object-search.vala |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/rygel/rygel-media-object-search.vala b/src/rygel/rygel-media-object-search.vala
index 460dc12..bed6b05 100644
--- a/src/rygel/rygel-media-object-search.vala
+++ b/src/rygel/rygel-media-object-search.vala
@@ -51,9 +51,9 @@ internal class Rygel.MediaObjectSearch<G> : GLib.Object, Rygel.StateMachine {
     }
 
     public void run () {
-        var container = this.containers.get (0);
+        if (this.containers.size > 0) {
+            var container = this.containers.get (0);
 
-        if (container != null) {
             container.find_object (this.id,
                                    this.cancellable,
                                    this.on_object_found);



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