[smuxi: 1/2] Frontend-GNOME: fixed NRE thrown in MessageTextView.AddMessage() (closes: #962)



commit 2223ae93ccc95b89f71bf5634ab7ec9d296912ed
Author: Mirco Bauer <meebey meebey net>
Date:   Wed Apr 23 12:26:33 2014 +0200

    Frontend-GNOME: fixed NRE thrown in MessageTextView.AddMessage() (closes: #962)

 src/Frontend-GNOME/Views/MessageTextView.cs |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/src/Frontend-GNOME/Views/MessageTextView.cs b/src/Frontend-GNOME/Views/MessageTextView.cs
index b3ee0e9..9cc57bf 100644
--- a/src/Frontend-GNOME/Views/MessageTextView.cs
+++ b/src/Frontend-GNOME/Views/MessageTextView.cs
@@ -360,6 +360,10 @@ namespace Smuxi.Frontend.Gnome
                 } else if (msgPart is TextMessagePartModel) {
                     var tags = new List<Gtk.TextTag>();
                     TextMessagePartModel fmsgti = (TextMessagePartModel) msgPart;
+                    if (fmsgti.Text == null) {
+                        // Gtk.TextBuffer.Insert*() asserts on text == NULL
+                        continue;
+                    }
                     if (fmsgti.ForegroundColor != TextColor.None) {
                         var bg = ColorConverter.GetTextColor(BackgroundColor);
                         if (fmsgti.BackgroundColor != TextColor.None) {


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