Skip to content

Commit

Permalink
ignore nil-Option's
Browse files Browse the repository at this point in the history
  • Loading branch information
lmittmann committed Aug 2, 2023
1 parent 7d80b9b commit 62266e2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ func NewClient(client *rpc.Client, opts ...Option) *Client {
client: client,
}
for _, opt := range opts {
if opt == nil {
continue
}
opt(c)
}
return c
Expand Down
3 changes: 3 additions & 0 deletions w3vm/vm.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ type vmOptions struct {
func New(opts ...Option) *VM {
v := &VM{opts: new(vmOptions)}
for _, opt := range opts {
if opt == nil {
continue
}
opt(v)
}

Expand Down

0 comments on commit 62266e2

Please sign in to comment.