Skip to content

Commit

Permalink
Fixed nil pointer error in corecli
Browse files Browse the repository at this point in the history
  • Loading branch information
memclutter committed Jan 7, 2022
1 parent 0ed993e commit fdb482b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/corecli/dependencies.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ func CloseDependencies(v reflect.Value) error {
}[pkgPath]

if isCloser {
if closer, ok := fieldValueOf.Interface().(io.Closer); ok {
if closer, ok := fieldValueOf.Interface().(io.Closer); ok && closer != nil {
if err := closer.Close(); err != nil {
return fmt.Errorf("%s: error close %v", pkgPath, err)
}
Expand Down

0 comments on commit fdb482b

Please sign in to comment.