Fix crash on close patch rebased for stable
Merge pull request #570 from diizy/stable-1.0

Fix crash on close patch rebased for stable