From 8fdf805f1fc5e322928b26720db92b834fbc0d7a Mon Sep 17 00:00:00 2001 From: Houtan Bastani Date: Tue, 5 Feb 2019 19:36:11 +0100 Subject: [PATCH] handle case when node is not passed to error function --- matlab/ols/parse_ols_style_equation.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/matlab/ols/parse_ols_style_equation.m b/matlab/ols/parse_ols_style_equation.m index 7a2289ac3..acef0686f 100644 --- a/matlab/ols/parse_ols_style_equation.m +++ b/matlab/ols/parse_ols_style_equation.m @@ -193,7 +193,7 @@ end %% Helper Functions function parsing_error(msg, line, node) -if ~isempty(node) +if nargin == 3 && ~isempty(node) error('\nERROR encountered parsing `%s` in equation on line %d: %s\n', printNode(node), line, msg); else error('\nERROR encountered parsing of equation on line %d: %s\n', num2str(line), msg)