timedatectl: do not show (null) if the address of NTP server is not resolved

This commit is contained in:
Yu Watanabe 2020-07-17 02:56:29 +09:00
parent d96edb2c6e
commit 94ec163ad2

View file

@ -409,7 +409,7 @@ static int print_ntp_status_info(NTPStatusInfo *i) {
if (r < 0)
return table_log_add_error(r);
r = table_add_cell_stringf(table, NULL, "%s (%s)", i->server_address, i->server_name);
r = table_add_cell_stringf(table, NULL, "%s (%s)", strna(i->server_address), strna(i->server_name));
if (r < 0)
return table_log_add_error(r);