Skip to content
Snippets Groups Projects
Verified Commit 9c880bb7 authored by Volker Schukai's avatar Volker Schukai :alien:
Browse files

fix panic is format is nil

parent 74e1c9d7
No related branches found
No related tags found
No related merge requests found
...@@ -37,9 +37,10 @@ func (s *Settings[c]) HasFile(file string) bool { ...@@ -37,9 +37,10 @@ func (s *Settings[c]) HasFile(file string) bool {
func (s *Settings[C]) AddFile(file string, format ...Format) *Settings[C] { func (s *Settings[C]) AddFile(file string, format ...Format) *Settings[C] {
var f Format var f Format
f = RecogniseFormat
if len(format) <= 1 { if format == nil || len(format) == 0 {
f = RecogniseFormat
} else if format != nil && len(format) == 1 {
f = format[0] f = format[0]
} else { } else {
panic("too many arguments") panic("too many arguments")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment