fixed segfault in piano roll when no pattern is open

Fixes #29