Fix NPE caused by a double redirect race condition