From fe467119d28ed6bce02909c9727515c193a169fc Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Tue, 23 Mar 2021 14:14:03 +0100 Subject: [PATCH] fix: add forgotten nullcheck --- sonic-radiance.love/core/scenemanager.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sonic-radiance.love/core/scenemanager.lua b/sonic-radiance.love/core/scenemanager.lua index 56143b9..60c5a79 100644 --- a/sonic-radiance.love/core/scenemanager.lua +++ b/sonic-radiance.love/core/scenemanager.lua @@ -104,11 +104,15 @@ end -- Add send keys functions to the scene function SceneManager:keypressed( key, scancode, isrepeat ) - self.currentScene:keypressed( key, scancode, isrepeat ) + if (self.currentScene ~= nil) then + self.currentScene:keypressed( key, scancode, isrepeat ) + end end function SceneManager:keyreleased( key ) - self.currentScene:keyreleased( key ) + if (self.currentScene ~= nil) then + self.currentScene:keyreleased( key ) + end end -- DRAW FUNCTIONS