Skip return value check for stopped repeating tasks.

If the repeated task stopped itself, the return value does not matter,
therefore we don't have to check it.

Bug: webrtc:10365
Change-Id: I4a2c7a40a287dd0a8099628e228e9c319409576b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/127545
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27121}
diff --git a/rtc_base/task_utils/repeating_task.cc b/rtc_base/task_utils/repeating_task.cc
index 8d64334..0cc9a62 100644
--- a/rtc_base/task_utils/repeating_task.cc
+++ b/rtc_base/task_utils/repeating_task.cc
@@ -30,13 +30,13 @@
     return true;
 
   TimeDelta delay = RunClosure();
-  RTC_DCHECK(delay.IsFinite());
 
   // The closure might have stopped this task, in which case we return true to
   // destruct this object.
   if (next_run_time_.IsPlusInfinity())
     return true;
-
+  
+  RTC_DCHECK(delay.IsFinite());
   TimeDelta lost_time = Timestamp::us(rtc::TimeMicros()) - next_run_time_;
   next_run_time_ += delay;
   delay -= lost_time;