Skip to content

Commit 6474e17

Browse files
committed
use inherits to check classes
1 parent 492d657 commit 6474e17

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

R/0_helpers.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
date <- Sys.Date()
1313
}
1414

15-
if (class(date) != "Date") {
15+
if (!inherits(date, "Date")) {
1616
date <- as.Date(date)
1717
}
1818

R/mfl_players.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#' @export
1919

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

0 commit comments

Comments
 (0)