The code before worked as long as `block` was not `nil`.  If it was `nil`, it would get a `NoMethodError` because it always tried to call `source_location` on it (since `Proc#source_location` existed as a defined method).

The fix is to check at runtime so that if the block is `nil` we fall back to `caller`.