fix #29256: Add a linked staff in note entry mode causes crash