# HG changeset patch # User ladanyi # Date 1135011545 0 # Node ID 15cf1fd6a505fca0af33c6847234de709ad26af5 # Parent c2de2ed28e599caa27c092563db488adab293857 Fix crash when the input file does not contain any nodeset or edgeset. diff -r c2de2ed28e59 -r 15cf1fd6a505 gui/mapstorage.cc --- a/gui/mapstorage.cc Mon Dec 19 14:58:09 2005 +0000 +++ b/gui/mapstorage.cc Mon Dec 19 16:59:05 2005 +0000 @@ -212,6 +212,22 @@ ContentReader content(lreader); lreader.run(); + if (content.nodeSetNum() < 1) + { + Gtk::MessageDialog mdialog("No nodeset found in file."); + mdialog.run(); + clear(); + return 1; + } + + if (content.edgeSetNum() < 1) + { + Gtk::MessageDialog mdialog("No edgeset found in file."); + mdialog.run(); + clear(); + return 1; + } + const std::vector& nodeMapNames = content.nodeSetMaps(0); const std::vector& edgeMapNames = content.edgeSetMaps(0); @@ -256,7 +272,7 @@ } GuiReader gui_reader(greader, this); greader.run(); - } catch (DataFormatError& error) { + } catch (Exception& error) { Gtk::MessageDialog mdialog(error.what()); mdialog.run(); clear();