File tree Expand file tree Collapse file tree 2 files changed +2
-6
lines changed Expand file tree Collapse file tree 2 files changed +2
-6
lines changed Original file line number Diff line number Diff line change @@ -101,9 +101,7 @@ Return the first section that matches on of the given `names`.
101
101
"""
102
102
function findfirst (sections:: Sections , names:: Vector{String} )
103
103
results = findall (sections, names)
104
- if isempty (results)
105
- error (" Could not find any sections that match $(names) " )
106
- end
104
+ isempty (results) && return nothing
107
105
return first (results)
108
106
end
109
107
Original file line number Diff line number Diff line change @@ -101,9 +101,7 @@ Return the first section that matches on of the given `names`.
101
101
"""
102
102
function findfirst (symbols:: Symbols , names:: Vector{String} )
103
103
results = findall (symbols, names)
104
- if isempty (results)
105
- error (" Could not find any symbols that match $(names) " )
106
- end
104
+ isempty (results) && return nothing
107
105
return first (results)
108
106
end
109
107
You can’t perform that action at this time.
0 commit comments