Skip to content

Commit

Permalink
Actually fix things
Browse files Browse the repository at this point in the history
  • Loading branch information
rundel committed Oct 17, 2020
1 parent 79f64c7 commit ef52a90
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions R/encode.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,18 @@ encode_obj = function(obj, compress = c("bzip2", "gzip", "xz", "none")) {
#'
#' @export
decode_obj = function(txt, compress = c("bzip2", "gzip", "xz", "none")) {
compress = match.arg(compress)

if (txt == "")
return(list())

res = try({
compress = match.arg(compress)

comp_raw = base64enc::base64decode(txt)
raw = memDecompress(comp_raw, type = compress)
unserialize(raw)
}, silent = TRUE)

if (inherits("try-error"))
if (inherits(res, "try-error"))
res = list()

res
Expand Down

0 comments on commit ef52a90

Please sign in to comment.