OSDN Git Service

静的フィールドに関するnull参照の警告が出ている箇所を修正
authorKimura Youichi <kim.upsilon@bucyou.net>
Mon, 23 Sep 2019 19:23:27 +0000 (04:23 +0900)
committerKimura Youichi <kim.upsilon@bucyou.net>
Tue, 24 Sep 2019 12:58:00 +0000 (21:58 +0900)
OpenTween.Tests/Models/PostClassTest.cs
OpenTween/ApplicationEvents.cs
OpenTween/MyCommon.cs
OpenTween/Thumbnail/ThumbnailGenerator.cs

index 7f97dcf..63c115b 100644 (file)
@@ -47,7 +47,7 @@ namespace OpenTween.Models
 
         private static Dictionary<long, PostClass> TestCases;
 
-        public PostClassTest()
+        static PostClassTest()
         {
             PostClassTest.TestCases = new Dictionary<long, PostClass>
             {
index afd8f5e..9266ecf 100644 (file)
@@ -55,7 +55,7 @@ namespace OpenTween
         /// <summary>
         /// 起動時に指定されたオプションを取得します
         /// </summary>
-        public static IDictionary<string, string> StartupOptions { get; private set; }
+        public static IDictionary<string, string> StartupOptions { get; private set; } = null!;
 
         /// <summary>
         /// アプリケーションのメイン エントリ ポイントです。
index 8f8d6ee..0094be0 100644 (file)
@@ -59,7 +59,7 @@ namespace OpenTween
     {
         private static readonly object LockObj = new object();
         public static bool _endingFlag;        //終了フラグ
-        public static string settingPath;
+        public static string settingPath = null!;
 
         public enum IconSizes
         {
index 9a207c3..e84e473 100644 (file)
@@ -38,7 +38,7 @@ namespace OpenTween.Thumbnail
     {
         public static List<IThumbnailService> Services { get; protected set; }
 
-        internal static ImgAzyobuziNet ImgAzyobuziNetInstance { get; private set; }
+        internal static ImgAzyobuziNet ImgAzyobuziNetInstance { get; private set; } = null!;
 
         static ThumbnailGenerator()
             => ThumbnailGenerator.Services = new List<IThumbnailService>();