Can you reproduce why the client is undefined? But here it doesn't seem to prevent further failures, it's just postponing them, unless it's because some sort of async mechanism (e.g. we check before it's actually set, but it doesn't seem to be the case).