fix possible crash for barline and hidden staff