When I was doing the challenge my instinct was to call DontDestroyOnLoad for the fader within Transition(). But then I realized the Fader was already in that scene.
It got me wondering – should the Portal script and namely the Transition method rely on fader already being in the DontDestroyOnLoad scene? My instinct is no, so I added checks for it. Checking an objects scene seems to be the correct way to do this (code below). Curious on feedback here.
FWIW, I also put null checks for the otherPortal parameter passed within UpdatePlayer since its possible for GetOtherPortal() to return null. I think the performance cost for simple input validation (e.g. null checks, bounds checks) is pretty negligible so I tend to do them.
Fader fader = FindObjectOfType<Fader>();
if (fader.gameObject.scene.name != "DontDestroyOnLoad")
{
DontDestroyOnLoad(fader);
}