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

Avoid modifying XHR proxy that no longer exists #1345

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions packages/driver/src/cypress/server.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -315,12 +315,16 @@ create = (options = {}) ->
## to test this just use a regular XHR
@aborted = true

abortStack = server.getStack()

proxy = server.getProxyFor(@)
proxy.aborted = true

options.onXhrAbort(proxy, abortStack)
## Sometimes abort is called after the proxy
## objects have already been cleaned up (long
## polling). Don't try to abort if it
## does not exist
if proxy
abortStack = server.getStack()
proxy.aborted = true

options.onXhrAbort(proxy, abortStack)

if _.isFunction(options.onAnyAbort)
route = server.getRouteForXhr(@)
Expand Down