diff src/error.cc @ 6640:379244420c72

[project @ 2007-05-21 19:50:45 by jwe]
author jwe
date Mon, 21 May 2007 19:50:45 +0000
parents d00da2148c53
children 673686daec87
line wrap: on
line diff
--- a/src/error.cc	Mon May 21 19:47:22 2007 +0000
+++ b/src/error.cc	Mon May 21 19:50:45 2007 +0000
@@ -727,7 +727,7 @@
 {
   va_list args;
   va_start (args, fmt);
-  error_1 (std::cerr, "error", id, fmt, args);
+  error_1 (std::cerr, 0, id, fmt, args);
   va_end (args);
 }
 
@@ -858,17 +858,20 @@
 		{
 		  Octave_map err_stack = err.contents("stack")(0).map_value ();
 
-		  if (err_stack.contains ("file"))
-		    file = err_stack.contents("file")(0).string_value ();
-
-		  if (err_stack.contains ("name"))
-		    nm = err_stack.contents("name")(0).string_value ();
+		  if (err_stack.numel () > 0)
+		    {
+		      if (err_stack.contains ("file"))
+			file = err_stack.contents("file")(0).string_value ();
 
-		  if (err_stack.contains ("line"))
-		    l = err_stack.contents("line")(0).nint_value ();
+		      if (err_stack.contains ("name"))
+			nm = err_stack.contents("name")(0).string_value ();
 
-		  if (err_stack.contains ("column"))
-		    c = err_stack.contents("column")(0).nint_value ();
+		      if (err_stack.contains ("line"))
+			l = err_stack.contents("line")(0).nint_value ();
+
+		      if (err_stack.contains ("column"))
+			c = err_stack.contents("column")(0).nint_value ();
+		    }
 		}
 
 	      // Ugh.