diff src/error.cc @ 12705:4972eb61c6d6

Fix bug with error() not accepting an empty struct input (Bug #33428). * nargchk.m, nargoutchk.m: Return scalar empty struct if there is no error. * error.cc: Accept empty struct as input with no error, per Matlab.
author Rik <octave@nomad.inbox5.com>
date Sat, 04 Jun 2011 16:10:38 -0700
parents da6cbb752368
children a0875c6cab7e
line wrap: on
line diff
--- a/src/error.cc	Sat Jun 04 16:05:37 2011 -0700
+++ b/src/error.cc	Sat Jun 04 16:10:38 2011 -0700
@@ -1066,6 +1066,10 @@
 
           octave_scalar_map m = args(0).scalar_map_value ();
 
+          // empty struct is not an error.  return and resume calling function.
+          if (m.nfields () == 0)
+            return retval;
+
           if (m.contains ("message"))
             {
               octave_value c = m.getfield ("message");