Fix crash if all MT servers are offline (#14)

master
HimbeerserverDE 2021-02-20 18:09:23 +01:00
parent 493faef463
commit f80e1aeb5b
No known key found for this signature in database
GPG Key ID: 1A651504791E6A8B
1 changed files with 3 additions and 0 deletions

View File

@ -116,6 +116,9 @@ func bestCap(defs [][]byte, capabs []*ToolCapabs) *ItemDef {
}
}
if bestK >= len(defs) {
return &ItemDef{}
}
return &ItemDef{data: defs[bestK]}
}