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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user