Skip to content

Commit 6fc1cac

Browse files
author
Ryan Patrick Kyle
committed
throw error if request$body is NULL
1 parent 140bf51 commit 6fc1cac

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

R/dash.R

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,11 +256,19 @@ Dash <- R6::R6Class(
256256

257257
# set the callback context associated with this invocation of the callback
258258
private$callback_context_ <- setCallbackContext(request$body)
259-
259+
260+
# throw an exception when request$body is NULL
261+
if (is.null(private$callback_context_)) {
262+
stop("callback_context cannot be stored if request$body is NULL.")
263+
}
264+
260265
output_value <- getStackTrace(do.call(callback, callback_args),
261266
debug = private$debug,
262267
pruned_errors = private$pruned_errors)
263-
268+
269+
# reset callback context
270+
private$callback_context_ <- NULL
271+
264272
# pass on output_value to encode_plotly in case there are dccGraph
265273
# components which include Plotly.js figures for which we'll need to
266274
# run plotly_build from the plotly package

0 commit comments

Comments
 (0)