[folks] Don't overwrite an Individual's avatar with null.



commit ad743d5f78f56ba2358ac60fdbbf9985380729c7
Author: Travis Reitter <travis reitter collabora co uk>
Date:   Mon Mar 14 07:58:37 2011 -0700

    Don't overwrite an Individual's avatar with null.
    
    (unlike the previous commit, this one actually...)
    
    Fixes: bgo#644165 - An individual's avatar shouldn't be replaced by a null
    avatar

 folks/individual.vala |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/folks/individual.vala b/folks/individual.vala
index ab16b2e..a3a1b86 100644
--- a/folks/individual.vala
+++ b/folks/individual.vala
@@ -856,14 +856,15 @@ public class Folks.Individual : Object,
     {
       File avatar = null;
 
-      this._persona_list.foreach ((p) =>
+      foreach (var p in this._persona_list)
         {
-          if (avatar == null && p is AvatarDetails)
+          if (p is AvatarDetails)
             {
               avatar = ((AvatarDetails) p).avatar;
-              return;
+              if (avatar != null)
+                break;
             }
-        });
+        }
 
       /* only notify if the value has changed */
       if (this.avatar != avatar)



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