From 958faafe4332c09b150a18c6fe19d00a0e3e8efc Mon Sep 17 00:00:00 2001
From: unknown <olivier.delaigue@ANPI1430.antony.irstea.priv>
Date: Tue, 21 Nov 2017 08:53:17 +0100
Subject: [PATCH] v0.1.8.5 bug fixed in ObsGR when input data are defined by
 vectors #5010

---
 DESCRIPTION | 4 ++--
 R/ObsGR.R   | 6 ++++--
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/DESCRIPTION b/DESCRIPTION
index 5d94d21..0895ead 100644
--- a/DESCRIPTION
+++ b/DESCRIPTION
@@ -1,8 +1,8 @@
 Package: airGRteaching
 Type: Package
 Title: Tools to Simplify the Use of the airGR Hydrological Package for Education (Including a Shiny Interface)
-Version: 0.1.8.4
-Date: 2017-10-31
+Version: 0.1.8.5
+Date: 2017-11-21
 Authors@R: c(person("Olivier", "Delaigue", role = c("aut", "cre"), email = "airGR@irstea.fr"), person("Laurent", "Coron", role = c("aut")), person("Pierre", "Brigode", role = c("aut")), person("Guillaume", "Thirel", role = c("ctb")))
 Depends: airGR (>= 1.0.9.43)
 Imports: xts, dygraphs (>= 1.1.1.4), shiny, shinyjs, plotrix, markdown
diff --git a/R/ObsGR.R b/R/ObsGR.R
index 9ea8ad7..522ab99 100644
--- a/R/ObsGR.R
+++ b/R/ObsGR.R
@@ -7,8 +7,10 @@ ObsGR <- function(ObsBV = NULL, DatesR = NULL, Precip = NULL, PotEvap = NULL, Qo
     stop("Missing input data")
   }
 
-  if (ncol(ObsBV) >= 5) {
-    TempMean <- ObsBV[, 5L]
+  if (!is.null(ObsBV)) {
+    if (ncol(ObsBV) >= 5) {
+      TempMean <- ObsBV[, 5L]
+    }
   }
   if (!is.null(TempMean)) {
     TempMean <- TempMean
-- 
GitLab