[OGL] Fix a possible null pointer dereference