Check scanner error in GetXrayLogs

Add a check for scanner.Err() after scanning log lines and return nil if an error occurred. This prevents further processing of potentially incomplete or invalid log entries when the scanner encountered an error.
This commit is contained in:
MHSanaei 2026-05-04 17:02:00 +02:00
parent e9979b6774
commit fb75e3d7c7
No known key found for this signature in database
GPG key ID: 7E4060F2FBE5AB7A

View file

@ -846,6 +846,10 @@ func (s *ServerService) GetXrayLogs(
entries = append(entries, entry)
}
if err := scanner.Err(); err != nil {
return nil
}
if len(entries) > countInt {
entries = entries[len(entries)-countInt:]
}