Skip to content

Commit e9944c8

Browse files
committed
Fail with new igraph version
1 parent 943d702 commit e9944c8

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

R/versions.R

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,14 +97,20 @@ upgrade_graph <- function(graph) {
9797
## Check that the version is the latest
9898

9999
warn_version <- function(graph) {
100-
if (graph_version() != graph_version(graph)) {
100+
their_version <- graph_version(graph)
101+
102+
if (pkg_graph_version == their_version) {
103+
return(FALSE)
104+
}
105+
106+
if (pkg_graph_version > their_version) {
101107
message(
102108
"This graph was created by an old(er) igraph version.\n",
103109
" Call upgrade_graph() on it to use with the current igraph version\n",
104110
" For now we convert it on the fly..."
105111
)
106-
TRUE
107-
} else {
108-
FALSE
112+
return(TRUE)
109113
}
114+
115+
stop("This graph was created by a new(er) igraph version. Please install the latest version of igraph and try again.")
110116
}

0 commit comments

Comments
 (0)