From ddd48d34a05fb540f40fd81c61a25f99f0d7f741 Mon Sep 17 00:00:00 2001 From: Walter Bender Date: Fri, 15 Oct 2010 19:19:07 +0000 Subject: more rigorous connection checking to prevent crashing on reading bad project data (#2447) --- (limited to 'TurtleArt/tautils.py') diff --git a/TurtleArt/tautils.py b/TurtleArt/tautils.py index 7565c4e..025c4f4 100644 --- a/TurtleArt/tautils.py +++ b/TurtleArt/tautils.py @@ -121,10 +121,9 @@ def _tuplify(tup): def get_id(connection): """ Get a connection block ID. """ - if connection is None: - return None - return connection.id - + if connection is not None and hasattr(connection, 'id'): + return connection.id + return None def json_dump(data): """ Save data using available JSON tools. """ -- cgit v0.9.1