Commit 92abc50a authored by Florent D'Halluin's avatar Florent D'Halluin
Browse files

[yavgui] Fix crash on closing last automaton.

* yavgui/src/yavgui.cc: Do not raise an exception when selecting
a non-existing instance.
parent ed15236d
2009-08-04 d-halluin <d-halluin@lrde.epita.fr>
[yavgui] Fix crash on closing last automaton.
* yavgui/src/yavgui.cc: Do not raise an exception when selecting
a non-existing instance.
2009-08-04 d-halluin <d-halluin@lrde.epita.fr>
 
[yavgui] Handle intial & final labels.
......
......@@ -223,15 +223,15 @@ namespace yavgui
void Yavgui::select_instance (int index)
{
if (index < 0 || index >= (int) instances_.size ())
throw exceptions::InstanceNotFound ();
if (current_view_)
{
current_view_->hide ();
layout_->removeWidget (current_view_);
}
if (index < 0 || index >= (int) instances_.size ())
return;
current_view_ = instances_[index]->view ();
layout_->insertWidget (1, current_view_, 1);
current_view_->show ();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment