Merge "Do not crash if window is invalid" into rvc-dev