Fix crash on close patch rebased for stable