Use correct default label for contexts. Fixes #91

NULL apparently is not a valid value for a field in a reference class.
This commit is contained in:
Winston Chang
2013-01-25 14:51:50 -06:00
parent 8df1b9e8e5
commit fe1e833677
2 changed files with 3 additions and 3 deletions

View File

@@ -8,7 +8,7 @@ Context <- setRefClass(
.flushCallbacks = 'list'
),
methods = list(
initialize = function(label=NULL) {
initialize = function(label='') {
id <<- .getReactiveEnvironment()$nextId()
.invalidated <<- FALSE
.invalidateCallbacks <<- list()

View File

@@ -229,7 +229,7 @@ ShinyApp <- setRefClass(
return(httpResponse(404, 'text/html', '<h1>Not Found</h1>'))
filename <- ifelse(is.function(download$filename),
Context$new()$run(download$filename),
Context$new('[download]')$run(download$filename),
download$filename)
# If the URL does not contain the filename, and the desired filename
@@ -246,7 +246,7 @@ ShinyApp <- setRefClass(
tmpdata <- tempfile()
on.exit(unlink(tmpdata))
result <- try(Context$new()$run(function() { download$func(tmpdata) }))
result <- try(Context$new('[download]')$run(function() { download$func(tmpdata) }))
if (is(result, 'try-error')) {
return(httpResponse(500, 'text/plain',
attr(result, 'condition')$message))