[smuxi/stable] Frontend-GNOME: workaround ArgumentException in PreferencesDialog._Load() (closes: #1082)



commit 0af9c48282e27e61f34330fa842860153f93429a
Author: Mirco Bauer <meebey meebey net>
Date:   Sat Jan 16 14:00:24 2016 +0100

    Frontend-GNOME: workaround ArgumentException in PreferencesDialog._Load() (closes: #1082)
    
    On Mono 4.0.5 Encoding.GetEncoding(int) throws for some reason an
    ArgumentException which crashes Smuxi. We catch this exception to prevent that
    crash.

 .../Preferences/PreferencesDialog.cs               |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/src/Frontend-GNOME/Preferences/PreferencesDialog.cs 
b/src/Frontend-GNOME/Preferences/PreferencesDialog.cs
index 6e7fed8..5d21df9 100644
--- a/src/Frontend-GNOME/Preferences/PreferencesDialog.cs
+++ b/src/Frontend-GNOME/Preferences/PreferencesDialog.cs
@@ -383,6 +383,9 @@ namespace Smuxi.Frontend.Gnome
                     }
                     store.AppendValues(normalizedBodyName + " - " + encodingName, enc.BodyName.ToUpper());
                 } catch (NotSupportedException) {
+                } catch (ArgumentException) {
+                    // HACK: workaround bug in Mono's Encoding.GetEncoding()
+                    // implementation, see: https://smuxi.im/issues/show/1082
                 }
             }
             cb.Model = store;


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