Check if header exists before reading value
This commit is contained in:
parent
c0e8f717e8
commit
4677f4fe4a
1 changed files with 5 additions and 1 deletions
|
|
@ -323,7 +323,11 @@ public class Geary.RFC822.Header : Geary.MessageData.BlockMessageData, Geary.RFC
|
|||
}
|
||||
|
||||
public string? get_header(string name) throws RFC822Error {
|
||||
return GMime.utils_header_unfold(get_headers().get_header(name).get_raw_value());
|
||||
GMime.Header header = get_headers().get_header(name);
|
||||
if (header != null)
|
||||
return GMime.utils_header_unfold(header.get_raw_value());
|
||||
else
|
||||
return null;
|
||||
}
|
||||
|
||||
public string[] get_header_names() throws RFC822Error {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue