Don't call love.graphics functions in love.run until a window has been created, prevents segfaults when love.window and love.graphics were loaded, but there was no window

This commit is contained in:
Bart van Strien
2013-12-02 21:07:43 +01:00
parent 1c8abc74aa
commit 33bb049ee6
2 changed files with 4 additions and 3 deletions
+1 -1
View File
@@ -494,7 +494,7 @@ function love.run()
-- Call update and draw
if love.update then love.update(dt) end -- will pass 0 if love.timer is disabled
if love.window and love.graphics then
if love.window and love.graphics and love.window.isCreated() then
love.graphics.clear()
love.graphics.origin()
if love.draw then love.draw() end