Skip to content

Commit

Permalink
use inherits to check classes
Browse files Browse the repository at this point in the history
  • Loading branch information
tanho63 committed Feb 11, 2023
1 parent 492d657 commit 6474e17
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion R/0_helpers.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
date <- Sys.Date()
}

if (class(date) != "Date") {
if (!inherits(date, "Date")) {
date <- as.Date(date)
}

Expand Down
2 changes: 1 addition & 1 deletion R/mfl_players.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#' @export

mfl_players <- function(conn = NULL) {
if (!is.null(conn) && class(conn) != "mfl_conn") {
if (!is.null(conn) && !inherits(conn, "mfl_conn")) {
stop("conn must be generated by 'mfl_connect()' and have type 'mfl_conn'")
}

Expand Down

0 comments on commit 6474e17

Please sign in to comment.