From 03750ccc004f0b39ff012da3c96c57661e8890eb Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Thu, 11 Jan 2024 19:34:29 +0200 Subject: [PATCH] ANother null check --- R/fit.R | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/R/fit.R b/R/fit.R index 3580c602..f1bf4786 100644 --- a/R/fit.R +++ b/R/fit.R @@ -341,8 +341,9 @@ init_model_methods <- function(seed = 0, verbose = FALSE, hessian = FALSE, force } require_suggested_package("Rcpp") require_suggested_package("RcppEigen") - if (length(private$model_methods_env_$hpp_code_) == 0 && - !file.exists(private$model_methods_env_$obj_file_)) { + if (length(private$model_methods_env_$hpp_code_) == 0 && ( + is.null(private$model_methods_env_$obj_file_) || + !file.exists(private$model_methods_env_$obj_file_))) { stop("Model methods cannot be used with a pre-compiled Stan executable, ", "the model must be compiled again", call. = FALSE) }