COIN-OR::LEMON - Graph Library

Changeset 101:7234b7fabd05 in glemon-0.x


Ignore:
Timestamp:
12/19/05 17:59:05 (18 years ago)
Author:
Akos Ladanyi
Branch:
gui
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk/gui@2441
Message:

Fix crash when the input file does not contain any nodeset or edgeset.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • mapstorage.cc

    r98 r101  
    213213    lreader.run();
    214214
     215    if (content.nodeSetNum() < 1)
     216    {
     217      Gtk::MessageDialog mdialog("No nodeset found in file.");
     218      mdialog.run();
     219      clear();
     220      return 1;
     221    }
     222
     223    if (content.edgeSetNum() < 1)
     224    {
     225      Gtk::MessageDialog mdialog("No edgeset found in file.");
     226      mdialog.run();
     227      clear();
     228      return 1;
     229    }
     230
    215231    const std::vector<std::string>& nodeMapNames = content.nodeSetMaps(0);
    216232    const std::vector<std::string>& edgeMapNames = content.edgeSetMaps(0);
     
    257273    GuiReader gui_reader(greader, this);
    258274    greader.run();
    259   } catch (DataFormatError& error) {
     275  } catch (Exception& error) {
    260276    Gtk::MessageDialog mdialog(error.what());
    261277    mdialog.run();
Note: See TracChangeset for help on using the changeset viewer.