From d0247277f9484ec0438c46fcdac4c0f49425414b Mon Sep 17 00:00:00 2001
From: Michel Juillard <michel.juillard@mjui.fr>
Date: Mon, 25 Nov 2019 21:54:53 +0100
Subject: [PATCH] after check, oo_.dr isn't empty but oo_.dr.ghx + friends
 don't exist

---
 matlab/perfect-foresight-models/det_cond_forecast.m | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/matlab/perfect-foresight-models/det_cond_forecast.m b/matlab/perfect-foresight-models/det_cond_forecast.m
index 0819820f9e..98875fb917 100644
--- a/matlab/perfect-foresight-models/det_cond_forecast.m
+++ b/matlab/perfect-foresight-models/det_cond_forecast.m
@@ -39,7 +39,7 @@ end
 %We have to get an initial guess for the conditional forecast
 % and terminal conditions for the non-stationary variables, we
 % use the first order approximation of the rational expectation solution.
-if ~isfield(oo_,'dr') || (isempty(oo_.dr))
+if ~isfield(oo_,'dr') || ~isfield(oo_.dr,'ghx')
     fprintf('computing the first order solution of the model as initial guess...');
     dr = struct();
     oo_.dr=set_state_space(dr,M_,options_);
-- 
GitLab