From 3783d1d01b458a56a4de6aba4a2d10605bfbc876 Mon Sep 17 00:00:00 2001 From: xuri Date: Wed, 10 Feb 2021 00:04:13 +0800 Subject: [PATCH] This closes #782, fix unmerge all cells cause corrupted file --- merge.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/merge.go b/merge.go index ec7815f..c50eaa3 100644 --- a/merge.go +++ b/merge.go @@ -148,6 +148,9 @@ func (f *File) UnmergeCell(sheet string, hcell, vcell string) error { } ws.MergeCells.Cells = ws.MergeCells.Cells[:i] ws.MergeCells.Count = len(ws.MergeCells.Cells) + if ws.MergeCells.Count == 0 { + ws.MergeCells = nil + } return nil }