Use the origin-buffer since the origin-buffer will always be the original source file and not some intermediary coverage buffer.
Remove superfluous nil in the if form.