xan: Prevent NULL dereferences with missing reference frame