Skip to content

Commit

Permalink
Merge pull request #43 from bgokden/refactor
Browse files Browse the repository at this point in the history
Added a check to avoid errors
  • Loading branch information
bgokden authored Jul 2, 2021
2 parents fc09814 + 46fa706 commit 179ae6d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions data/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,9 @@ func (dt *Data) AddSource(dataSource DataSource) error {
if dt.Sources == nil {
dt.InitData()
}
if dt.Sources != nil {
return errors.New("Sources is still nil")
}
return dt.Sources.Add(dataSource.GetID(), dataSource, cache.DefaultExpiration)
}

Expand Down

0 comments on commit 179ae6d

Please sign in to comment.