Open Bug 1947892 Opened 1 month ago Updated 1 month ago

Don't call nsMsgDBService::OpenDBFromFile() with a null folder param.

Categories

(MailNews Core :: General, task)

Tracking

(Not tracked)

People

(Reporter: benc, Unassigned)

References

Details

nsMsgDBService::OpenDBFromFile() currently supports being called with a null folder parameter.
It shouldn't.
Rationale:
It cannot create the correct kind of database without knowing the folder, and it also leaves the database not knowing which folder it belongs to, which creates big problems when you try to use nsIMsgHdr objects it serves up.

The only nullptr use appears to be in nsImapMailFolder::RenameClient, where the database is created before the folder. It should be an easy change - RenameClient() should just create the folder then use it's database - but there are likely complications. I'm guessing OpenDBFromFile() was used to bypass the usual DB notifications, so there needs to be some analysis as to why it's done like this here and not in other places (e.g. compare it to the local folder rename).

You need to log in before you can comment on or make changes to this bug.