Fix null-pointer dereference on error handling during VR view drawing

This commit is contained in:
Julian Eisel 2021-12-14 20:44:17 +01:00
parent 7afd84df40
commit 4cfa21f09b
1 changed files with 4 additions and 1 deletions

View File

@ -1317,7 +1317,10 @@ static void wm_xr_session_surface_draw(bContext *C)
GHOST_XrSessionDrawViews(wm->xr.runtime->context, &draw_data);
GPU_framebuffer_restore();
/* There's no active framebuffer if the session was cancelled (exception while drawing views). */
if (GPU_framebuffer_active_get()) {
GPU_framebuffer_restore();
}
}
static void wm_xr_session_do_depsgraph(bContext *C)