Fix a crash in DownloadDiffAction for 404 pages.

Review Request #13321 — Created Oct. 9, 2023 and submitted

Information

Review Board
release-6.x

Reviewers

DownloadDiffAction inspects the current resolved URL in order to
determine its state. This assumes that a resolver match was made, which
isn't the case when displaying an error page, such as a 404.

The code has been rewritten to first pull out request as a
HttpRequest, which exposes the typing problem around the resolver
match. It then checks the match before assuming it's not None.

Visited a 404 page. Saw that I no longer hit the crash.

Summary ID
Fix a crash in DownloadDiffAction for 404 pages.
`DownloadDiffAction` inspects the current resolved URL in order to determine its state. This assumes that a resolver match was made, which isn't the case when displaying an error page, such as a 404. The code has been rewritten to first pull out `request` as a `HttpRequest`, which exposes the typing problem around the resolver match. It then checks the match before assuming it's not `None`.
69ea56fe9d22bfca4301b8cfe5a92aa4abf33310
david
  1. Ship It!
  2. 
      
maubin
  1. Ship It!
  2. 
      
chipx86
Review request changed
Status:
Completed
Change Summary:
Pushed to release-6.x (0e6c5ce)