[smuxi: 173/179] Frontend-GNOME: fix error handling for image parts in MessageTextView.InsertToBuffer()



commit 145495d00a4e6a54f4384585c93c18e75e9e43e2
Author: Mirco Bauer <meebey meebey net>
Date:   Thu Oct 5 21:40:54 2017 +0800

    Frontend-GNOME: fix error handling for image parts in MessageTextView.InsertToBuffer()
    
    The InsertToBuffer() overload for ImageMessagePartModel is not returning when
    the URL of the image fails to parse. Thus the code control flow continues and
    then calls AddAlternativeText() a second time. Adding a return statement in the
    catch block fixes this issue.

 src/Frontend-GNOME/Views/MessageTextView.cs |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
---
diff --git a/src/Frontend-GNOME/Views/MessageTextView.cs b/src/Frontend-GNOME/Views/MessageTextView.cs
index ff8d98f..e9e1627 100644
--- a/src/Frontend-GNOME/Views/MessageTextView.cs
+++ b/src/Frontend-GNOME/Views/MessageTextView.cs
@@ -634,6 +634,7 @@ namespace Smuxi.Frontend.Gnome
                 scheme = uri.Scheme;
             } catch (UriFormatException) {
                 AddAlternativeText(buffer, ref iter, imgpart);
+                return;
             }
             switch (scheme) {
                 case "smuxi-emoji":


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