From d2109cc349188d0669c75142e05f25e1bde3ea80 Mon Sep 17 00:00:00 2001
From: Delaigue Olivier <olivier.delaigue@irstea.priv>
Date: Wed, 13 Mar 2019 09:02:28 +0100
Subject: [PATCH] v1.2.9.5 BUG: check if FUN_TRANSFO = NULL in Calibration

---
 DESCRIPTION     | 2 +-
 NEWS.rmd        | 2 +-
 R/Calibration.R | 4 +++-
 3 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/DESCRIPTION b/DESCRIPTION
index 47eb81f4..ad1c119c 100644
--- a/DESCRIPTION
+++ b/DESCRIPTION
@@ -1,7 +1,7 @@
 Package: airGR
 Type: Package
 Title: Suite of GR Hydrological Models for Precipitation-Runoff Modelling
-Version: 1.2.9.4
+Version: 1.2.9.5
 Date: 2019-03-13
 Authors@R: c(
   person("Laurent", "Coron", role = c("aut", "trl"), comment = c(ORCID = "0000-0002-1503-6204")),
diff --git a/NEWS.rmd b/NEWS.rmd
index af6e4d2d..5f49f786 100644
--- a/NEWS.rmd
+++ b/NEWS.rmd
@@ -13,7 +13,7 @@ output:
 
 
 
-### 1.2.9.4 Release Notes (2019-03-13) 
+### 1.2.9.5 Release Notes (2019-03-13) 
 
 
 
diff --git a/R/Calibration.R b/R/Calibration.R
index 6c6f4980..adc66d8e 100644
--- a/R/Calibration.R
+++ b/R/Calibration.R
@@ -4,7 +4,9 @@ Calibration <- function(InputsModel, RunOptions, InputsCrit, CalibOptions,
   FUN_MOD   <- match.fun(FUN_MOD)
   FUN_CRIT  <- match.fun(FUN_CRIT)
   FUN_CALIB <- match.fun(FUN_CALIB)
-  FUN_TRANSFO <- match.fun(FUN_TRANSFO)
+  if (!is.null(FUN_TRANSFO)) {
+    FUN_TRANSFO <- match.fun(FUN_TRANSFO)
+  }
   return(FUN_CALIB(InputsModel, RunOptions, InputsCrit, CalibOptions, FUN_MOD, FUN_CRIT, FUN_TRANSFO, verbose = verbose))
 }
 
-- 
GitLab