(WindowImp::render): Fix a bug when window is null