Skip to content
This repository has been archived by the owner on Feb 14, 2024. It is now read-only.

Commit

Permalink
Fix bug in start and end year where error set in wrong spot
Browse files Browse the repository at this point in the history
  • Loading branch information
heath140 committed May 3, 2023
1 parent 84b404b commit fbc9a40
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions database/sqliteData.go
Original file line number Diff line number Diff line change
Expand Up @@ -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++ {
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit fbc9a40

Please sign in to comment.