You should check for the `iostream == NULL` case and return early here.