diff --git a/Dotnet/MainForm.cs b/Dotnet/MainForm.cs index 87209ebc1..94d6dde84 100644 --- a/Dotnet/MainForm.cs +++ b/Dotnet/MainForm.cs @@ -139,13 +139,13 @@ private void MainForm_Resize(object sender, System.EventArgs e) LastSizeWidth = Size.Width; LastSizeHeight = Size.Height; - _saveTimer.Start(); + _saveTimer?.Start(); } private void SaveTimer_Tick(object sender, EventArgs e) { SaveWindowState(); - _saveTimer.Stop(); + _saveTimer?.Stop(); } private void MainForm_Move(object sender, System.EventArgs e) { @@ -156,7 +156,7 @@ private void MainForm_Move(object sender, System.EventArgs e) LastLocationX = Location.X; LastLocationY = Location.Y; - _saveTimer.Start(); + _saveTimer?.Start(); } private void MainForm_FormClosing(object sender, FormClosingEventArgs e)