Skip to content

Commit b538187

Browse files
committed
If missing field is attempted return FALSE
1 parent 712fe08 commit b538187

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

R/riskmetric.R

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,10 @@ assessment <- function(assessment) {
5353
#' @examples
5454
#' is_risk_error(1)
5555
is_risk_error <- function(x) {
56-
if (inherits(x, "pkg_metric")) {
56+
x <- tryCatch(x, error = identity)
57+
if (is(x, "simpleError")) {
58+
FALSE
59+
} else if (inherits(x, "pkg_metric")) {
5760
inherits(x, "pkg_metric_error") || inherits(x, "error")
5861
} else {
5962
NA

0 commit comments

Comments
 (0)