[blam] ItemView: Only show the author when there is at least one



commit 0d4016282e3a1ed87b92d3478446496d9bc86784
Author: Carlos Martín Nieto <carlos cmartin tk>
Date:   Sat Sep 18 22:14:15 2010 +0100

    ItemView: Only show the author when there is at least one

 src/ItemView.cs |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/src/ItemView.cs b/src/ItemView.cs
index b288556..3acc248 100644
--- a/src/ItemView.cs
+++ b/src/ItemView.cs
@@ -96,9 +96,13 @@ namespace Imendio.Blam {
         private void Load()
         {
 			Theme theme = Application.TheApp.ThemeManager.CurrentTheme;
-
-            string author  = (!currentItem.Authors[0].Name.Equals(string.Empty)) ?
+            string author;
+            if(currentItem.Authors.Count == 0){
+                author = string.Empty;
+            } else {
+                author  = (!currentItem.Authors[0].Name.Equals(string.Empty)) ?
                 String.Format(Catalog.GetString("by {0}"), currentItem.Authors[0].Name) : "&nbsp;";
+            }
             string link    = Catalog.GetString("Show in browser");
             string pubdate = (!currentItem.PublishDate.Equals(DateTime.MinValue)) ?
                 currentItem.PublishDate.ToString("D", System.Globalization.CultureInfo.CurrentUICulture) : "&nbsp;";



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