Add description to assert in history.dart (flutter/engine#46072)

I have hit this assertion error many times in tests and this message
would be helpful for debugging.

---------

Co-authored-by: Mouad Debbar <mdebbar@google.com>
This commit is contained in:
Kenzie Davisson
2023-09-25 10:57:44 -07:00
committed by GitHub
parent a915a49646
commit e70d4a1c1b

View File

@@ -217,7 +217,12 @@ class MultiEntriesBrowserHistory extends BrowserHistory {
_isTornDown = true;
// Restores the html browser history.
assert(_hasSerialCount(currentState));
assert(
_hasSerialCount(currentState),
currentState == null
? 'unexpected null history state'
: "history state is missing field 'serialCount'",
);
final int backCount = _currentSerialCount;
if (backCount > 0) {
await urlStrategy!.go(-backCount);