mirror of
https://github.com/golang/go
synced 2024-11-24 02:50:11 -07:00
net/textproto: prevent test from failing with nil pointer dereference
The variable err could have nil value when we call err.Error(), because after we check it for nil above we continue the test (t.Errorf doesn't stop the test execution). Updates #30208
This commit is contained in:
parent
ffd096db2b
commit
3ab20f6d7f
@ -332,7 +332,7 @@ func TestReadMultiLineError(t *testing.T) {
|
||||
if msg != wantMsg {
|
||||
t.Errorf("ReadResponse: msg=%q, want %q", msg, wantMsg)
|
||||
}
|
||||
if err.Error() != "550 "+wantMsg {
|
||||
if err != nil && err.Error() != "550 "+wantMsg {
|
||||
t.Errorf("ReadResponse: error=%q, want %q", err.Error(), "550 "+wantMsg)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user