Add null check for if render() was called before gl-init