Skip to content

Commit

Permalink
objSize -- obj_size "bad binding access" fails
Browse files Browse the repository at this point in the history
  • Loading branch information
eliotmcintire committed Jan 15, 2025
1 parent b979381 commit cfeb5cc
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions R/objectSize.R
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,14 @@ objSize.default <- function(x, quick = FALSE, ...) {
}
}
}
out <- obj_size(x)
out <- try(obj_size(x), silent = TRUE) # Error in obj_size_(dots, env, size_node(), size_vector()) :
# bad binding access
if (is(out, "try-error"))
out <- object.size(x)
if (exists("out2", inherits = FALSE)) {
out <- sum(out, out2)
class(out) <- "lobstr_bytes"
}
class(out) <- "lobstr_bytes"

if (!quick) {
attr(out, "objSize") <- list(obj = out)
Expand Down

0 comments on commit cfeb5cc

Please sign in to comment.