Fix a crash in some cases with notification library use.