If base URL is empty string, or null it would format this line to //a/changes... or /null/a/changes, we should handle that. One way is to remove first slash before %s and ensure that %s with null return empty string.