summaryrefslogtreecommitdiffstats
path: root/lib/network/connection.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/network/connection.pm')
-rw-r--r--lib/network/connection.pm2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/network/connection.pm b/lib/network/connection.pm
index d8ede2d..98e94da 100644
--- a/lib/network/connection.pm
+++ b/lib/network/connection.pm
@@ -267,7 +267,7 @@ sub write_settings {
my $file = network::network::get_ifcfg_file($self->get_interface);
network::network::write_interface_settings($self->build_ifcfg_settings, $file);
if ($self->{address}{hostname}) {
- $o_net->{network}{HOSTNAME} = $self->{address}{hostname};
+ $o_net->{network}{HOSTNAME} = $self->{address}{hostname} if $o_net;
network::network::write_hostname($self->{address}{hostname});
}
network::network::write_network_conf($o_net) if $o_net;