[smuxi] Frontend-GNOME: fixed potential null dereference



commit 9fe84deeb4907c8117b87fbc0fa44e385a7446fe
Author: Mirco Bauer <meebey meebey net>
Date:   Sun Feb 8 12:44:57 2015 +0100

    Frontend-GNOME: fixed potential null dereference

 src/Frontend-GNOME/Views/MessageTextView.cs |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/src/Frontend-GNOME/Views/MessageTextView.cs b/src/Frontend-GNOME/Views/MessageTextView.cs
index 94e34e7..96db4d8 100644
--- a/src/Frontend-GNOME/Views/MessageTextView.cs
+++ b/src/Frontend-GNOME/Views/MessageTextView.cs
@@ -1,7 +1,7 @@
 /*
  * Smuxi - Smart MUltipleXed Irc
  *
- * Copyright (c) 2009-2013 Mirco Bauer <meebey meebey net>
+ * Copyright (c) 2009-2015 Mirco Bauer <meebey meebey net>
  *
  * Full GPL License: <http://www.gnu.org/licenses/gpl.txt>
  *
@@ -532,12 +532,14 @@ namespace Smuxi.Frontend.Gnome
                 } else if (msgPart is ImageMessagePartModel) {
                     var imgpart = (ImageMessagePartModel) msgPart;
                     Uri uri = null;
+                    string scheme = null;
                     try {
                         uri = new Uri(imgpart.ImageFileName);
+                        scheme = uri.Scheme;
                     } catch (UriFormatException) {
                         AddAlternativeText(buffer, ref iter, imgpart);
                     }
-                    switch (uri.Scheme) {
+                    switch (scheme) {
                         case "smuxi-emoji":
                             var shortName = uri.Host;
                             AddEmoji(buffer, ref iter, imgpart, shortName);


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