Skip to content

Commit

Permalink
Don't attempt to call Shiny app if app is NULL
Browse files Browse the repository at this point in the history
Squelches a non-useful user-facing error message when a Shiny app
has been interrupted but a HTTP request is still in progress in
the app iframe.
  • Loading branch information
georgestagg committed Nov 27, 2023
1 parent a504138 commit 4eacfeb
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/messageporthttp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -318,14 +318,16 @@ async function handleHttpuvRequests(
tryCatch(
{
app <- get(appName, env = .shiny_app_registry)
app$call(
list(
PATH_INFO = "${scope.path}",
REQUEST_METHOD = "${scope.method}",
QUERY_STRING = "${scope.query_string}",
rook.input = reader
if (!is.null(app)) {
app$call(
list(
PATH_INFO = "${scope.path}",
REQUEST_METHOD = "${scope.method}",
QUERY_STRING = "${scope.query_string}",
rook.input = reader
)
)
)
}
},
finally = {
reader$destroy()
Expand Down

0 comments on commit 4eacfeb

Please sign in to comment.