Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix onUnknownRoute exception on back button in web #300

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

limexp
Copy link

@limexp limexp commented Aug 7, 2022

This PR fixes null-parameter exception in case of using onUnknownRoute.

pathTemplate could be null if onUnknownRoute is matched, but null is not accepted in fromRouteInformation https://github.com/tomgilder/routemaster/blob/main/lib/src/route_data.dart#L166

To generate an exception:

  1. add onUnknownRoute handler (onUnknownRoute: (path) { return MaterialPage(child: ProfilePage()); }, for simple_example)
  2. visit onUnknownRoute handled page and any next page
  3. press back button in web-browser to return to onUnknownRoute handled page

The following TypeErrorImpl was thrown while dispatching notifications for PlatformRouteInformationProvider:
Expected a value of type 'String', but got one of type 'Null'
packages/routemaster/src/route_data.dart 166:45 fromRouteInformation

@codecov
Copy link

codecov bot commented Jul 28, 2023

Codecov Report

Merging #300 (e6bc6d6) into main (620e070) will not change coverage.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #300   +/-   ##
=======================================
  Coverage   99.40%   99.40%           
=======================================
  Files          20       20           
  Lines        1005     1005           
=======================================
  Hits          999      999           
  Misses          6        6           
Files Changed Coverage Δ
lib/src/route_data.dart 100.00% <100.00%> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 620e070...e6bc6d6. Read the comment docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants