diff src/graphics.cc @ 11456:fbdb95640852

get: return empty matrix if no values are found
author John W. Eaton <jwe@octave.org>
date Fri, 07 Jan 2011 12:52:46 -0500
parents 2be9e22796d2
children d86389a6dc3f
line wrap: on
line diff
--- a/src/graphics.cc	Thu Jan 06 20:46:03 2011 +0100
+++ b/src/graphics.cc	Fri Jan 07 12:52:46 2011 -0500
@@ -6150,15 +6150,21 @@
     {
       octave_idx_type len = vals.numel ();
 
-      if (len > 1)
-        retval = vals;
+      if (len == 0)
+        retval = Matrix ();
       else if (len == 1)
         retval = vals(0);
+      else
+        retval = vals;
     }
 
   return retval;
 }
 
+/*
+%!assert (get (findobj (0, 'Tag', 'nonexistenttag'), 'nonexistentproperty'), [])
+*/
+
 // Return all properties from the graphics handle @var{h}.
 // If @var{h} is a vector, return a cell array including the
 // property values or lists respectively.