diff --git a/engine/src/flutter/lib/web_ui/lib/src/engine/navigation/history.dart b/engine/src/flutter/lib/web_ui/lib/src/engine/navigation/history.dart index dce3ba4213..ef90ad9c9f 100644 --- a/engine/src/flutter/lib/web_ui/lib/src/engine/navigation/history.dart +++ b/engine/src/flutter/lib/web_ui/lib/src/engine/navigation/history.dart @@ -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);