]> git.proxmox.com Git - qemu-server.git/blobdiff - PVE/API2/Qemu.pm
fix #2578: check if $target is provided in clone
[qemu-server.git] / PVE / API2 / Qemu.pm
index e15c0c366424e6001dc09de7fc805fd428a6a02b..5cbcc54e00e1d16d9d4e5eeef79dc524b5f5c60b 100644 (file)
@@ -2749,12 +2749,12 @@ __PACKAGE__->register_method({
 
         my $localnode = PVE::INotify::nodename();
 
-        if ($target && ($target eq $localnode || $target eq 'localhost')) {
+       if ($target eq $localnode || $target eq 'localhost') {
            undef $target;
-       } else {
-           PVE::Cluster::check_node_exists($target);
        }
 
+       PVE::Cluster::check_node_exists($target) if $target;
+
        my $storecfg = PVE::Storage::config();
 
        if ($storage) {