From fbc9a404c356d34020f7f65a2ab4220e2617cea6 Mon Sep 17 00:00:00 2001 From: Heath Kuntz Date: Wed, 3 May 2023 09:20:39 -0600 Subject: [PATCH] Fix bug in start and end year where error set in wrong spot --- database/sqliteData.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/database/sqliteData.go b/database/sqliteData.go index db08213..e854a3f 100644 --- a/database/sqliteData.go +++ b/database/sqliteData.go @@ -138,7 +138,7 @@ func GetAggResults(db *sqlx.DB, wel bool, excludeList []string) ([]MfResults, er } else { // don't exclude anything qry = AggResultsNoExclude } - } else { // is a recharge file + } else { // is a recharge file if len(excludeList) > 0 { // has an item in exclude list list := excludeList[0][0:3] for i := 1; i < len(excludeList); i++ { @@ -227,7 +227,11 @@ func GetStartEndYrs(db *sqlx.DB) (SYr, EYr int, err error) { } } - return SYr, EYr, errors.New("could not find Start and End Years") + if SYr == 0 || EYr == 0 { + return 0, 0, errors.New("could not find start/end year") + } + + return SYr, EYr, nil } func GetSteadyState(db *sqlx.DB) (bool, error) {