Can the `chain` be null here? It's just been set a few lines above.