- fix nullptr crash in player.camera reference when player.camera is nullptr

This commit is contained in:
Rachael Alexanderson 2020-03-26 07:45:27 -04:00 committed by Christoph Oelckers
parent f954df7a00
commit 7c9d8a0b99
2 changed files with 4 additions and 2 deletions

View file

@ -256,7 +256,8 @@ sector_t *FGLRenderer::RenderView(player_t* player)
NoInterpolateView = false;
// Shader start time does not need to be handled per level. Just use the one from the camera to render from.
gl_RenderState.CheckTimer(player->camera->Level->ShaderStartTime);
if (player->camera)
gl_RenderState.CheckTimer(player->camera->Level->ShaderStartTime);
// prepare all camera textures that have been used in the last frame.
// This must be done for all levels, not just the primary one!
for (auto Level : AllLevels())

View file

@ -404,7 +404,8 @@ sector_t *VulkanFrameBuffer::RenderView(player_t *player)
NoInterpolateView = false;
// Shader start time does not need to be handled per level. Just use the one from the camera to render from.
GetRenderState()->CheckTimer(player->camera->Level->ShaderStartTime);
if (player->camera)
GetRenderState()->CheckTimer(player->camera->Level->ShaderStartTime);
// prepare all camera textures that have been used in the last frame.
// This must be done for all levels, not just the primary one!
for (auto Level : AllLevels())