Skip to content

Commit

Permalink
Merge pull request #28 from spotlibs/fix/prevent-panic-on-log-activity
Browse files Browse the repository at this point in the history
fix: give default context when the input is nil
  • Loading branch information
mdanialr authored Nov 21, 2024
2 parents d9e5950 + 5fedbdc commit 25504af
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions log/activity.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ func (l actLogger) Info(m Map) {

// Activity start ActLogger.
func Activity(c context.Context) ActLogger {
// prevent panic
if c == nil {
c = context.Background()
}

actOnce.Do(func() {
// setup log writer
actLogWriter := &writer{wr: setupLog("activity")}
Expand Down

0 comments on commit 25504af

Please sign in to comment.