From 0c47eb7cb9669225a488166712183fc524c972b5 Mon Sep 17 00:00:00 2001 From: oweno-tfwm Date: Fri, 8 Sep 2023 09:49:59 +0100 Subject: [PATCH] tidy up exception handling --- R/atoc_export.R | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/R/atoc_export.R b/R/atoc_export.R index dd71dbe..7e551ad 100644 --- a/R/atoc_export.R +++ b/R/atoc_export.R @@ -320,10 +320,10 @@ makeCalendar <- function(schedule, ncores = 1) { set_TREAT_DATES_AS_INT( FALSE ) #revert treating date as int - if( TRUE==treatDatesAsInt && exists("res.calendar") ) + if( TRUE==treatDatesAsInt ) { - res.calendar = makeDateFieldsDateType( res.calendar ) - cancellations = makeDateFieldsDateType( cancellations ) + if (exists("res.calendar")){ res.calendar = makeDateFieldsDateType( res.calendar ) } + if (exists("cancellations")){ cancellations = makeDateFieldsDateType( cancellations ) } } })