Fix missing error check.

The notmuch_message_file_open function is perfectly capable of
returning NULL. So check for it.
This commit is contained in:
Carl Worth 2009-10-22 15:33:56 -07:00
parent 6a4992bc61
commit 90f93fc9c7

View file

@ -502,6 +502,10 @@ notmuch_database_add_message (notmuch_database_t *notmuch,
unsigned int i; unsigned int i;
message = notmuch_message_file_open (filename); message = notmuch_message_file_open (filename);
if (message == NULL) {
ret = NOTMUCH_STATUS_FILE_ERROR;
goto DONE;
}
notmuch_message_file_restrict_headers (message, notmuch_message_file_restrict_headers (message,
"date", "date",