The if - statement has not been added with this pull-request.
Right now I don't know when this could happen. I would have to dig deeper into this.
I added a warning log message since right now it would simply return without any output and without doing anything - and when this happens it would be extremely confusion for the user ... and I don't know if this is an error.
My guess is that this is a mechanism to make sure that the method doesn't throw an exception... maybe there is a historical reason for this if-statement and it is not needed anymore. I think in the future we might get rid if this statement ... it doesn't make sense to call _build_hosts without any hosts given.