Skip to content

Commit 063bd8d

Browse files
committed
More error checking
1 parent f9dd354 commit 063bd8d

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

main.go

+5-3
Original file line numberDiff line numberDiff line change
@@ -416,9 +416,11 @@ func main() {
416416
}
417417

418418
// Did we catch something?
419-
res := response.Entries[0].Attributes[0].ByteValues[0]
420-
if len(res) > 2 && res[0] == 0x17 && res[1] == 00 {
421-
outputqueue <- username
419+
if len(response.Entries) > 0 && len(response.Entries[0].Attributes) > 0 && len(response.Entries[0].Attributes[0].ByteValues) > 0 {
420+
res := response.Entries[0].Attributes[0].ByteValues[0]
421+
if len(res) > 2 && res[0] == 0x17 && res[1] == 00 {
422+
outputqueue <- username
423+
}
422424
}
423425

424426
// Should we start a new connection to avoid detection

0 commit comments

Comments
 (0)