Skip to content

Commit

Permalink
Fix for #110 - checked start has a value before referencing
Browse files Browse the repository at this point in the history
  • Loading branch information
CraigHawker committed Jul 20, 2023
1 parent 8d19af0 commit 44cc536
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,9 @@ public TimeSpan GetElapsedTime()
{
// If we are running then it's the difference between now and started.
if (this.CurrentTaskState == MFTaskState.MFTaskStateInProgress)
return DateTime.UtcNow.Subtract(this.Started.Value);
return this.Started.HasValue
? DateTime.UtcNow.Subtract(this.Started.Value)
: TimeSpan.Zero;

// If we have no start or last activity date then return zero.
if (false == this.Started.HasValue
Expand Down

0 comments on commit 44cc536

Please sign in to comment.