From 329153e48fef22eca9bdef056318823827cf3bdd Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Mon, 17 Mar 2008 12:04:15 -0300 Subject: [PATCH] Clean up error messages in case of unattached tuplet bracket. --- lily/spanner.cc | 2 +- lily/tuplet-engraver.cc | 16 ++++++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/lily/spanner.cc b/lily/spanner.cc index e73399dae0..0ae372ded3 100644 --- a/lily/spanner.cc +++ b/lily/spanner.cc @@ -191,7 +191,7 @@ Spanner::set_bound (Direction d, Grob *s) Item *i = dynamic_cast (s); if (!i) { - programming_error ("must have Item for spanner bound"); + programming_error ("must have Item for spanner bound of " + name()); return; } diff --git a/lily/tuplet-engraver.cc b/lily/tuplet-engraver.cc index 478469a1e2..5cd637e3f9 100644 --- a/lily/tuplet-engraver.cc +++ b/lily/tuplet-engraver.cc @@ -133,12 +133,16 @@ Tuplet_engraver::process_music () } else if (!bracket->get_bound (RIGHT)) { - bracket->set_bound (RIGHT, - bracket->get_bound (LEFT)); - number->set_bound (RIGHT, - stopped_tuplets_[i].bracket_->get_bound (LEFT)); - } - + if (bracket->get_bound (LEFT)) + { + bracket->set_bound (RIGHT, + bracket->get_bound (LEFT)); + number->set_bound (RIGHT, + stopped_tuplets_[i].bracket_->get_bound (LEFT)); + } + else + programming_error ("stopped tuplet bracket has left nor right bound."); + } // todo: scrap last_tuplets_, use stopped_tuplets_ only. // clear stopped_tuplets_ at start_translation_timestep last_tuplets_.push_back (bracket); -- 2.39.5