Skip to content

Commit

Permalink
Hotfix: Mode sanity check should be done before trying to open the lo…
Browse files Browse the repository at this point in the history
…om! #26
  • Loading branch information
dweemx committed Oct 2, 2020
1 parent 64c3702 commit 4f554a0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions R/loom.R
Original file line number Diff line number Diff line change
Expand Up @@ -2584,6 +2584,9 @@ open_loom <- function(
file.path,
mode="r"
) {
if(mode != "r" & mode != 'r+') {
stop("'r' (read) and 'r+' (read/write) modes are only allowed.")
}
loom <- tryCatch(
{
H5File$new(
Expand All @@ -2600,9 +2603,6 @@ open_loom <- function(
stop(e)
}
)
if(mode != "r" & mode != 'r+') {
stop("'r' (read) and 'r+' (read/write) modes are only allowed.")
}
if(is_loom_spec_version_3_or_greater(loom = loom)) {
warning("Loom specification version 3 or greater detected!")
} else {
Expand Down

0 comments on commit 4f554a0

Please sign in to comment.