check for null canvas