From ee8098037dc71028e755ae62dfeb823c0e7b366e Mon Sep 17 00:00:00 2001 From: Deepak S Date: Sat, 10 Jul 2021 09:47:41 +0530 Subject: Prevent panic when incorrect range is provided as PivotTableRange to (#874) --- adjust.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'adjust.go') diff --git a/adjust.go b/adjust.go index 28b62cc..ef7b19a 100644 --- a/adjust.go +++ b/adjust.go @@ -198,6 +198,10 @@ func (f *File) adjustAutoFilterHelper(dir adjustDirection, coordinates []int, nu // pair of coordinates. func (f *File) areaRefToCoordinates(ref string) ([]int, error) { rng := strings.Split(strings.Replace(ref, "$", "", -1), ":") + if len(rng) < 2 { + return nil, ErrParameterInvalid + } + return areaRangeToCoordinates(rng[0], rng[1]) } -- cgit v1.2.1