[blam] ItemView: Check to see if the author's name is null



commit 84deec3f2832f36280d3e87c7f94444ef60d2756
Author: Carlos Martín Nieto <carlos cmartin tk>
Date:   Sat Sep 25 21:19:10 2010 +0200

    ItemView: Check to see if the author's name is null

 src/ItemView.cs |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/src/ItemView.cs b/src/ItemView.cs
index 3acc248..fdafa8c 100644
--- a/src/ItemView.cs
+++ b/src/ItemView.cs
@@ -99,9 +99,10 @@ namespace Imendio.Blam {
             string author;
             if(currentItem.Authors.Count == 0){
                 author = string.Empty;
+            } else if(currentItem.Authors[0].Name != null){
+                author = String.Format(Catalog.GetString("by {0}"), currentItem.Authors[0].Name);
             } else {
-                author  = (!currentItem.Authors[0].Name.Equals(string.Empty)) ?
-                String.Format(Catalog.GetString("by {0}"), currentItem.Authors[0].Name) : "&nbsp;";
+                author  = "&nbsp;";
             }
             string link    = Catalog.GetString("Show in browser");
             string pubdate = (!currentItem.PublishDate.Equals(DateTime.MinValue)) ?



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