Browse Source

Only close rule file if it could be opened.

pull/42/merge
juliusv 12 years ago
parent
commit
619aa97025
  1. 2
      rules/load.go

2
rules/load.go

@ -114,9 +114,9 @@ func LoadExprFromString(exprString string) (ast.Node, error) {
func LoadExprFromFile(fileName string) (ast.Node, error) { func LoadExprFromFile(fileName string) (ast.Node, error) {
exprReader, err := os.Open(fileName) exprReader, err := os.Open(fileName)
defer exprReader.Close()
if err != nil { if err != nil {
return nil, err return nil, err
} }
defer exprReader.Close()
return LoadExprFromReader(exprReader) return LoadExprFromReader(exprReader)
} }

Loading…
Cancel
Save