gnucash: Ensure error is properly checked

This commit is contained in:
Aaron Lindsay 2017-11-25 21:05:57 -05:00
parent d9ecaa530b
commit 7a23739a0b
1 changed files with 2 additions and 2 deletions

View File

@ -344,8 +344,8 @@ func GnucashImportHandler(r *http.Request, context *Context) ResponseWriterWrite
// Does this look like a gzipped file?
var gnucashImport *GnucashImport
if gzHeader[0] == 0x1f && gzHeader[1] == 0x8b {
gzr, err := gzip.NewReader(bufread)
if err != nil {
gzr, err2 := gzip.NewReader(bufread)
if err2 != nil {
log.Print(err)
return NewError(999 /*Internal Error*/)
}