From 8f84f1ebd495d5075649cb7236f63f35a12c289c Mon Sep 17 00:00:00 2001 From: Jamie Cameron Date: Fri, 22 Jul 2022 12:06:34 -0700 Subject: [PATCH] Better handle out of order lines https://forum.virtualmin.com/t/perl-execution-error-when-trying-to-edit-an-lvm-through-webmin/116129 --- lvm/lvm-lib.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lvm/lvm-lib.pl b/lvm/lvm-lib.pl index c3bd1e2ca..3bc87dc2d 100755 --- a/lvm/lvm-lib.pl +++ b/lvm/lvm-lib.pl @@ -405,7 +405,7 @@ if (&get_lvm_version() >= 2) { elsif (/\s+Logical\s+volume\s+([a-z0-9\_]+)/i) { push(@raids, [ $1, undef ]); } - elsif (/\s+Logical\s+extents\s+(\d+)\s+to\s+(\d+)/ && @rv) { + elsif (/\s+Logical\s+extents\s+(\d+)\s+to\s+(\d+)/ && @raids) { $raids[$#raid]->[1] = $2-$1+1; } }