From 902a5d2788a928ec49ffcd81516cf1dfb64b07ce Mon Sep 17 00:00:00 2001 From: Houtan Bastani Date: Tue, 12 May 2015 10:54:24 +0200 Subject: [PATCH] ensure that mex file exists before doing comparison --- matlab/utilities/general/dyn_mex.m | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/matlab/utilities/general/dyn_mex.m b/matlab/utilities/general/dyn_mex.m index 12e4c0b8d..fe6b0555d 100644 --- a/matlab/utilities/general/dyn_mex.m +++ b/matlab/utilities/general/dyn_mex.m @@ -37,9 +37,11 @@ Dmex = dir([basename '_dynamic.' mexext]); % compile only if date of C file is greater than date of mex file % and force is not True -if (Dmex.datenum > Dc.datenum) && ~force - disp('Mex files are newer than the source: not recompiled') - return +if ~isempty(Dmex) + if (Dmex.datenum > Dc.datenum) && ~force + disp('Mex files are newer than the source: not recompiled') + return + end end if ~exist('OCTAVE_VERSION')