Fix error when hostname None value. See merge request !6402 (cherry picked from commit 31e99c96) 2faf685b Fix error when hostname None value.