From 98da192d605a0ab5a0b8ee568dda63cd9555dd20 Mon Sep 17 00:00:00 2001 From: Chris Bracken Date: Wed, 23 Nov 2016 17:46:05 -0800 Subject: [PATCH] Assert that time dilation is positive non-zero (#7011) Q: What happens if we set time dilation to zero? A: It would be bad. --- packages/flutter/lib/src/scheduler/binding.dart | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/flutter/lib/src/scheduler/binding.dart b/packages/flutter/lib/src/scheduler/binding.dart index 903db898c1..e9d4ba5647 100644 --- a/packages/flutter/lib/src/scheduler/binding.dart +++ b/packages/flutter/lib/src/scheduler/binding.dart @@ -23,6 +23,7 @@ double _timeDilation = 1.0; /// to ensure that time stamps seen by consumers of the scheduler binding are /// always increasing. set timeDilation(double value) { + assert(value > 0.0); if (_timeDilation == value) return; // We need to resetEpoch first so that we capture start of the epoch with the