[smuxi/stable] Engine: fix ArgumentNullException thrown in ServerModel.Save()
- From: Mirco M. M. Bauer <mmmbauer src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [smuxi/stable] Engine: fix ArgumentNullException thrown in ServerModel.Save()
- Date: Tue, 8 Jun 2021 14:21:35 +0000 (UTC)
commit 4cf007103b864d0b91d28c956b6fda368f22aeb5
Author: Mirco Bauer <meebey meebey net>
Date: Tue Jun 8 21:56:14 2021 +0800
Engine: fix ArgumentNullException thrown in ServerModel.Save()
When a server is serialized into the config an ArgumentNullException is thrown:
Exception Type:
System.ArgumentNullException
Exception Message:
Value cannot be null.
Parameter name: value
Exception StackTrace:
at Smuxi.Engine.UserConfig.Set (System.String key, System.Object value) [0x0001a] in
<f3a1234091714dbfa3231ad6d12c9efa>:0
at Smuxi.Engine.UserConfig.set_Item (System.String key, System.Object value) [0x00001] in
<f3a1234091714dbfa3231ad6d12c9efa>:0
at (wrapper remoting-invoke-with-check) Smuxi.Engine.UserConfig.set_Item(string,object)
at Smuxi.Engine.ServerModel.Save (Smuxi.Engine.UserConfig config) [0x00135] in
<f3a1234091714dbfa3231ad6d12c9efa>:0
at Smuxi.Engine.ServerListController.AddServer (Smuxi.Engine.ServerModel server) [0x00134] in
<f3a1234091714dbfa3231ad6d12c9efa>:0
at Smuxi.Frontend.Gnome.MenuWidget.OnAddServerActionActivated (System.Object sender,
System.EventArgs e) [0x0005b] in <1b690ecd2141485a99f79b236cb55f92>:0
ServerModel.ClientCertificateFilename can be null when Smuxi frontends don't
expose the feature in the user interface, which ServerWidget of the GNOME
frontend is not exposing (yet).
This bug was introduced in 83a2ab1c3e64ef4438b8e901891270f65566ea95 when CertFP
support was added.
src/Engine/Config/ServerModel.cs | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/src/Engine/Config/ServerModel.cs b/src/Engine/Config/ServerModel.cs
index bbbeccf8..a897063c 100644
--- a/src/Engine/Config/ServerModel.cs
+++ b/src/Engine/Config/ServerModel.cs
@@ -229,8 +229,10 @@ namespace Smuxi.Engine
config[ConfigKeyPrefix + "UseEncryption"] = UseEncryption;
config[ConfigKeyPrefix + "ValidateServerCertificate"] =
ValidateServerCertificate;
+ // ClientCertificateFilename is an internal setting which not
+ // exposed in the UI, thus the value remains null
config[ConfigKeyPrefix + "ClientCertificateFilename"] =
- ClientCertificateFilename;
+ ClientCertificateFilename ?? String.Empty;
config[ConfigKeyPrefix + "OnStartupConnect"] = OnStartupConnect;
config[ConfigKeyPrefix + "OnConnectCommands"] = OnConnectCommands;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]