From c49ffa3d1b2ffe9183b4d6775624b32fe216c7d4 Mon Sep 17 00:00:00 2001 From: Shulhan Date: Tue, 10 Sep 2019 01:50:25 +0700 Subject: ini: check for possible nil variable on Write --- lib/ini/ini.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ini/ini.go b/lib/ini/ini.go index 5bc1ea7b..c5ee7d3d 100644 --- a/lib/ini/ini.go +++ b/lib/ini/ini.go @@ -1039,7 +1039,7 @@ func (in *Ini) Write(w io.Writer) (err error) { } // Check if the last variable is an empty line. - if isLineModeVar(v.mode) { + if v != nil && isLineModeVar(v.mode) { endWithVar = true } else { endWithVar = false -- cgit v1.3