From 01df2c5e88480b781aaab6717c4a38eb408774ee Mon Sep 17 00:00:00 2001 From: Stuart Carnie Date: Fri, 6 Jul 2018 23:37:15 -0700 Subject: [PATCH] fix(Metal): Check for nil drawable --- gfx/common/metal/Context.m | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gfx/common/metal/Context.m b/gfx/common/metal/Context.m index 5e3fae6012..59066fccf6 100644 --- a/gfx/common/metal/Context.m +++ b/gfx/common/metal/Context.m @@ -280,7 +280,11 @@ dispatch_semaphore_signal(inflight); }]; - [_commandBuffer presentDrawable:self.nextDrawable]; + if (self.nextDrawable) + { + [_commandBuffer presentDrawable:self.nextDrawable]; + } + [_commandBuffer commit]; _commandBuffer = nil;