Fix assignment in error handling for EML parsing function

Correct the variable assignment in the `if err` statement to ensure proper error handling. This change eliminates a potential bug where the wrong variable might be used.
This commit is contained in:
Winni Neessen 2024-10-24 14:49:24 +02:00
parent 887e3cd768
commit 9f1e1976fe
Signed by: wneessen
GPG key ID: 385AC9889632126E

2
eml.go
View file

@ -93,7 +93,7 @@ func EMLToMsgFromFile(filePath string) (*Msg, error) {
return msg, fmt.Errorf("failed to parse EML file: %w", err) return msg, fmt.Errorf("failed to parse EML file: %w", err)
} }
if err := parseEML(parsedMsg, bodybuf, msg); err != nil { if err = parseEML(parsedMsg, bodybuf, msg); err != nil {
return msg, fmt.Errorf("failed to parse EML contents: %w", err) return msg, fmt.Errorf("failed to parse EML contents: %w", err)
} }