Skip to content

Commit

Permalink
add check for character(0)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Patrick Kyle committed Apr 9, 2019
1 parent 5c4e23f commit 756954f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions R/dash.R
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ Dash <- R6::R6Class(
private$assets_url_path <- sub("/$", "", assets_url_path)
private$assets_ignore <- assets_ignore
private$suppress_callback_exceptions <- suppress_callback_exceptions

gsub("^/+|/+$", "", assets_folder)
# config options
self$config$routes_pathname_prefix <- resolve_prefix(routes_pathname_prefix, "DASH_ROUTES_PATHNAME_PREFIX")
self$config$requests_pathname_prefix <- resolve_prefix(requests_pathname_prefix, "DASH_REQUESTS_PATHNAME_PREFIX")
Expand All @@ -150,7 +150,8 @@ Dash <- R6::R6Class(
# ------------------------------------------------------------
router <- routr::RouteStack$new()

if (!(is.null(private$assets_folder))) {
# ensure that assets_folder is neither NULL nor character(0)
if (!(is.null(private$assets_folder)) & length(private$assets_folder) != 0) {
if (!(dir.exists(private$assets_folder)) && gsub("/+", "", assets_folder) != "assets") {
warning(sprintf(
"The supplied assets folder, '%s', could not be found in the project directory.",
Expand Down

0 comments on commit 756954f

Please sign in to comment.