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