Skip to content

Commit

Permalink
Merge pull request #523 from ChIoT-Tech/master
Browse files Browse the repository at this point in the history
Dont panic if there are files with short names in the file store folder.
  • Loading branch information
MattBrittan committed Jul 19, 2021
2 parents b9726c5 + 4323374 commit fcebf05
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion filestore.go
Expand Up @@ -168,7 +168,7 @@ func (store *FileStore) all() []string {
for _, f := range files {
DEBUG.Println(STR, "file in All():", f.Name())
name := f.Name()
if name[len(name)-4:] != msgExt {
if len(name) < len(msgExt) || name[len(name)-len(msgExt):] != msgExt {
DEBUG.Println(STR, "skipping file, doesn't have right extension: ", name)
continue
}
Expand Down

0 comments on commit fcebf05

Please sign in to comment.