Do you need to check (or assert) that sf is not NULL here?