Skip to content

Commit

Permalink
Merge pull request #9 from nuttmeister/bugfix-ctx-notset
Browse files Browse the repository at this point in the history
Fixed bug with context not being set.
  • Loading branch information
nuttmeister authored Aug 15, 2019
2 parents 867bd00 + cc47bab commit cd2840f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion llogger.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,13 @@ func Create(ctx context.Context, inp Input) *Client {
// the context on each iteration.
func (l *Client) UpdateContext(ctx context.Context) {
// If context is nil there is no need to set the context.
if l.context == nil {
if ctx == nil {
return
}

// Set context.
l.context = ctx

// If we can't get Deadline from context set context to nil and
// print an error message.
d, ok := l.context.Deadline()
Expand Down

0 comments on commit cd2840f

Please sign in to comment.