Hrm - `get_appropriate_tracefile_ref()` can actually return `NULL` for a non-programmer error, so I think `g_return_if_fail()` here is wrong. I'm OK with just bailing out if `ostream == NULL` here, as we already print a critical inside `get_appropriate_tracefile_ref()` when it fails.