Unverified Commit 2449928d authored by Shi-Hao Hong's avatar Shi-Hao Hong Committed by GitHub

Add null check to _IndicatorPainter._tabOffsetsEqual() to prevent crash (#40009)

* Add tabOffsetEqual null check with TODO
parent 45d57e78
......@@ -419,7 +419,9 @@ class _IndicatorPainter extends CustomPainter {
}
static bool _tabOffsetsEqual(List<double> a, List<double> b) {
if (a?.length != b?.length)
// TODO(shihaohong): The following null check should be replaced when a fix
// for https://github.com/flutter/flutter/issues/40014 is available.
if (a == null || b == null || a.length != b.length)
return false;
for (int i = 0; i < a.length; i += 1) {
if (a[i] != b[i])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment