diff --git a/virtual_feature.pl b/virtual_feature.pl index d375b56..bd81596 100644 --- a/virtual_feature.pl +++ b/virtual_feature.pl @@ -2525,7 +2525,8 @@ sub feature_restore } # Fix up home directory if changed -if ($oldd && $d->{'home'} ne $oldd->{'home'}) { +if ($oldd && $d->{'home'} && $oldd->{'home'} && + $d->{'home'} ne $oldd->{'home'}) { &recursive_change_directives( $server, $oldd->{'home'}, $d->{'home'}, 0, 1); } diff --git a/virtualmin-nginx-lib.pl b/virtualmin-nginx-lib.pl index c7852ac..43151ca 100644 --- a/virtualmin-nginx-lib.pl +++ b/virtualmin-nginx-lib.pl @@ -1541,6 +1541,7 @@ sub switch_write_user sub recursive_change_directives { my ($parent, $oldv, $newv, $suffix, $prefix, $infix) = @_; +return if (!$oldv); foreach my $dir (@{$parent->{'members'}}) { my $changed = 0; foreach my $w (@{$dir->{'words'}}) {