OSDN Git Service

C# 8.0 のnull許容参照型を有効化
[opentween/open-tween.git] / OpenTween / Setting / SettingCommon.cs
index 353f425..dd1f359 100644 (file)
@@ -24,6 +24,8 @@
 // the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor,
 // Boston, MA 02110-1301, USA.
 
+#nullable enable
+
 using System;
 using System.Xml.Serialization;
 using System.Collections.Generic;
@@ -42,7 +44,7 @@ namespace OpenTween
             => SaveSettings(this);
         #endregion
 
-        public List<UserAccount> UserAccounts;
+        public List<UserAccount> UserAccounts = new List<UserAccount>();
         public string UserName = "";
 
         [XmlIgnore]
@@ -99,7 +101,7 @@ namespace OpenTween
         }
 
         public long UserId = 0;
-        public List<string> TabList;
+        public List<string> TabList = new List<string>();
         public int TimelinePeriod = 90;
         public int ReplyPeriod = 180;
         public int DMPeriod = 600;
@@ -245,14 +247,14 @@ namespace OpenTween
 
         /// <summary>アップデート通知を無視するバージョン番号</summary>
         [XmlIgnore]
-        public Version SkipUpdateVersion
+        public Version? SkipUpdateVersion
         {
             get => string.IsNullOrEmpty(this.SkipUpdateVersionStr) ? null : Version.Parse(this.SkipUpdateVersionStr);
             set => this.SkipUpdateVersionStr = value == null ? "" : value.ToString();
         }
 
         [XmlElement(ElementName = nameof(SkipUpdateVersion))]
-        public string SkipUpdateVersionStr { get; set; }
+        public string SkipUpdateVersionStr { get; set; } = "";
     }
 
     public class UserAccount