Browse code

Fix error handling when you open an invalid file.

From: Marius Gedminas <marius@gedmin.as>

Jose.R.Fonseca authored on 02/09/2008 00:18:40
Showing 1 changed files

  • xdot.py index 48256e1..68b1f4f 100755
... ...
@@ -597,8 +597,8 @@ class XDotParser:
597 597
     def parse(self):
598 598
         graph = pydot.graph_from_dot_data(self.xdotcode)
599 599
 
600
-        if graph.bb is None:
601
-            return GraphParseError()
600
+        if graph is None:
601
+            raise GraphParseError()
602 602
 
603 603
         xmin, ymin, xmax, ymax = map(int, graph.bb.split(","))
604 604