OSDN Git Service

NullRef対応
authorkiri_feather <kiri_feather@users.sourceforge.jp>
Mon, 27 Jun 2011 16:46:21 +0000 (01:46 +0900)
committerKimura Youichi <kim.upsilon@bucyou.net>
Sat, 18 Feb 2012 14:19:44 +0000 (23:19 +0900)
Tween/ToolStripAPIGauge.vb

index f8002b9..eb3ff9a 100644 (file)
@@ -44,7 +44,7 @@ Public Class ToolStripAPIGauge
     Public Property GaugeHeight As Integer
         Set(ByVal value As Integer)
             Me._gaugeHeight = value
-            If Not Me.Control.IsDisposed Then Me.Control.Refresh()
+            If Me.Control IsNot Nothing AndAlso Not Me.Control.IsDisposed Then Me.Control.Refresh()
         End Set
         Get
             Return _gaugeHeight
@@ -55,7 +55,7 @@ Public Class ToolStripAPIGauge
     Public Property MaxCount As Integer
         Set(ByVal value As Integer)
             Me._maxCount = value
-            If Not Me.Control.IsDisposed Then
+            If Me.Control IsNot Nothing AndAlso Not Me.Control.IsDisposed Then
                 Me.SetText(Me._remainCount, Me._maxCount)
                 Me.Control.Refresh()
             End If
@@ -69,7 +69,7 @@ Public Class ToolStripAPIGauge
     Public Property RemainCount As Integer
         Set(ByVal value As Integer)
             Me._remainCount = value
-            If Not Me.Control.IsDisposed Then
+            If Me.Control IsNot Nothing AndAlso Not Me.Control.IsDisposed Then
                 Me.SetText(Me._remainCount, Me._maxCount)
                 Me.Control.Refresh()
             End If
@@ -83,7 +83,7 @@ Public Class ToolStripAPIGauge
     Public Property ResetTime As DateTime
         Set(ByVal value As DateTime)
             Me._resetTime = value
-            If Not Me.Control.IsDisposed Then
+            If Me.Control IsNot Nothing AndAlso Not Me.Control.IsDisposed Then
                 Me.SetText(Me._remainCount, Me._maxCount)
                 Me.Control.Refresh()
             End If