Commit 265d66b2 authored by David's avatar David
Browse files

fix: crash of calcOverAbstraction with Warmup of RunModelSupervisor

Refs #144
2 merge requests!93Draft: Version 0.7.0,!74Resolve "Highlight the water deficit at a node due to too much withdrawals"
Pipeline #54537 failed with stage
in 7 minutes and 9 seconds
Showing with 6 additions and 4 deletions
+6 -4
...@@ -160,10 +160,12 @@ calcOverAbstraction <- function(O, WarmUp) { ...@@ -160,10 +160,12 @@ calcOverAbstraction <- function(O, WarmUp) {
if(WarmUp) { if(WarmUp) {
f <- lapply(f, function(x) paste0("WarmUp", x)) f <- lapply(f, function(x) paste0("WarmUp", x))
} }
if (any(O[[f$sim]] < 0)) { if (!is.null(O[[f$sim]])) {
O[[f$over]] <- rep(0, length(O[[f$sim]])) if (any(O[[f$sim]] < 0)) {
O[[f$over]][O[[f$sim]] < 0] <- - O[[f$sim]][O[[f$sim]] < 0] O[[f$over]] <- rep(0, length(O[[f$sim]]))
O[[f$sim]][O[[f$sim]] < 0] <- 0 O[[f$over]][O[[f$sim]] < 0] <- - O[[f$sim]][O[[f$sim]] < 0]
O[[f$sim]][O[[f$sim]] < 0] <- 0
}
} }
return(O) return(O)
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment