Fix #3639: Crash when hiding two or more selected patches while PatchInspector is visible