diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm index 9450b16d..a7014867 100644 --- a/PVE/API2/Qemu.pm +++ b/PVE/API2/Qemu.pm @@ -1551,9 +1551,10 @@ __PACKAGE__->register_method({ # read spice ticket from STDIN my $spice_ticket; if ($stateuri && ($stateuri eq 'tcp') && $migratedfrom && ($rpcenv->{type} eq 'cli')) { - my $line = <>; - chomp $line; - $spice_ticket = $line if $line; + if (my $line = <>) { + chomp $line; + $spice_ticket = $line; + } } my $storecfg = PVE::Storage::config();