[pve-devel] [PATCH zsync 1/2] fix #1587: sync: check if job state is defined

Thomas Lamprecht t.lamprecht at proxmox.com
Mon Nov 19 17:56:32 CET 2018


just because the $job hash is populated it's state key doesn't needs
to be..

Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
---
 pve-zsync | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pve-zsync b/pve-zsync
index b9a6995..4c00f47 100755
--- a/pve-zsync
+++ b/pve-zsync
@@ -574,7 +574,7 @@ sub sync {
 	$job = get_job($param);
     };
 
-    if ($job && $job->{state} eq "syncing") {
+    if ($job && defined($job->{state}) && $job->{state} eq "syncing") {
 	die "Job --source $param->{source} --name $param->{name} is syncing at the moment";
     }
 
-- 
2.19.1





More information about the pve-devel mailing list