Skip to content

Commit

Permalink
fix NA case
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Patrick Kyle committed Nov 1, 2019
1 parent 206e0f8 commit 2bec8dc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions R/dash.R
Original file line number Diff line number Diff line change
Expand Up @@ -647,17 +647,17 @@ Dash <- R6::R6Class(
}

getServerParam <- function(value, type, default) {
if (is.na(value))
if (length(value) == 0 || is.na(value))
return(default)
if (!is.null(value) && type %in% c("double", "integer") && value < 0)
if (type %in% c("double", "integer") && value < 0)
return(default)
if (!is.null(value) && toupper(value) %in% c("TRUE", "FALSE"))
if (toupper(value) %in% c("TRUE", "FALSE"))
value <- as.logical(toupper(value))
if (type == "integer")
value <- as.integer(value)
if (type == "double")
value <- as.double(value)
if (value != "" && length(value) != 0 && typeof(value) == type && !is.na(value)) {
if (value != "" && typeof(value) == type) {
return(value)
} else {
return(default)
Expand Down

0 comments on commit 2bec8dc

Please sign in to comment.