rubycdp / ferrum

Headless Chrome Ruby API
https://ferrum.rubycdp.com
MIT License
1.7k stars 122 forks source link

Handle nil request in `Exchange#navigation_request?` #339

Closed francisbeaudoin closed 1 year ago

francisbeaudoin commented 1 year ago

Details

As the Exchange object is pushed to the network traffic before assigning its request, it is assumed that the request can be nil in the exchange object.

https://github.com/rubycdp/ferrum/blob/d14161363c0a7b75c23f9c37a382eb838fa4b76b/lib/ferrum/network.rb#L355-L357 https://github.com/rubycdp/ferrum/blob/d14161363c0a7b75c23f9c37a382eb838fa4b76b/lib/ferrum/network.rb#L368

For that reason, the #navigation_request? method was updated to be nil safe.