OSDN Git Service

AkashiTimer.GetTimersがnullを返さないようにする
authorKazuhiro Fujieda <fujieda@users.sourceforge.jp>
Thu, 8 Jan 2015 14:33:48 +0000 (23:33 +0900)
committerKazuhiro Fujieda <fujieda@users.sourceforge.jp>
Thu, 8 Jan 2015 16:54:39 +0000 (01:54 +0900)
KancolleSniffer/AkashiTimer.cs
KancolleSniffer/ShipInfoLabels.cs

index cae35b6..d2caee2 100644 (file)
@@ -60,7 +60,7 @@ namespace KancolleSniffer
         private class RepairStatus\r
         {\r
             private ShipStatus[] _target;\r
-            private RepairTime[][] _times;\r
+            private RepairTime[][] _times = new RepairTime[0][];\r
             private DateTime _prev;\r
             public DateTime Start { get; set; }\r
             public int[] Deck { private get; set; }\r
@@ -75,7 +75,7 @@ namespace KancolleSniffer
                 Start = DateTime.MinValue;\r
                 Deck = null;\r
                 _target = null;\r
-                _times = null;\r
+                _times = new RepairTime[0][];\r
             }\r
 \r
             public bool DeckChanged(int[] deck)\r
@@ -104,8 +104,6 @@ namespace KancolleSniffer
 \r
             public RepairSpan[] GetTimers()\r
             {\r
-                if (_times == null)\r
-                    return null;\r
                 return (from times in _times\r
                     select times == null\r
                         ? new RepairSpan(0, TimeSpan.MinValue)\r
index 69c656d..654cccf 100644 (file)
@@ -124,7 +124,7 @@ namespace KancolleSniffer
             {\r
                 var label = _akashiTimers[i];\r
                 var labelHp = _labels[i][0];\r
-                if (timers == null || i >= timers.Length || timers[i].Span == TimeSpan.MinValue)\r
+                if (i >= timers.Length || timers[i].Span == TimeSpan.MinValue)\r
                 {\r
                     label.Visible = false;\r
                     labelHp.ForeColor = Control.DefaultForeColor;\r