1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 13:47:45 +00:00

Userland: Make representation of 'null' IPv4-address friendlier

Show an empty column rather than 'null' in SystemMonitor and show
'no IP' in the network applet if the adapter has no IPv4-address
configured.
This commit is contained in:
Thomas Wagenveld 2021-07-30 19:58:17 +02:00 committed by Gunnar Beutner
parent 3a40287776
commit df6db8b8cc
2 changed files with 5 additions and 2 deletions

View file

@ -122,7 +122,7 @@ private:
int connected_adapters = 0;
json.value().as_array().for_each([&adapter_info, include_loopback, &connected_adapters](auto& value) {
auto& if_object = value.as_object();
auto ip_address = if_object.get("ipv4_address").to_string();
auto ip_address = if_object.get("ipv4_address").as_string_or("no IP");
auto ifname = if_object.get("name").to_string();
auto link_up = if_object.get("link_up").as_bool();
auto link_speed = if_object.get("link_speed").to_i32();