Guard the canvas a bit, it can potentially be null
This would happen fairly consistently on Linux when loading a document in Gemini, so let's just make sure we avoid dereferencing a null pointer here.