fix #23131: crash on deletion of selection that includes last measure of score