In my testing, I found that `callback` is not always defined, so this check is necessary to avoid reference errors.