mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 13:21:05 +00:00
Bug 1660893 - Don't crash when the remote agent can't be initialized, r=remote-protocol-reviewers,whimboo
Set the command line handler to null when we can't start the service Differential Revision: https://phabricator.services.mozilla.com/D90463
This commit is contained in:
parent
7121ee534b
commit
0e2ebe15cb
@ -29,8 +29,11 @@ macro_rules! fatalln {
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn new_remote_agent_handler(result: *mut *const nsICommandLineHandler) {
|
||||
let handler: RefPtr<RemoteAgentHandler> = RemoteAgentHandler::new().unwrap();
|
||||
RefPtr::new(handler.coerce::<nsICommandLineHandler>()).forget(&mut *result);
|
||||
if let Ok(handler) = RemoteAgentHandler::new() {
|
||||
RefPtr::new(handler.coerce::<nsICommandLineHandler>()).forget(&mut *result);
|
||||
} else {
|
||||
*result = std::ptr::null();
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(xpcom)]
|
||||
|
Loading…
Reference in New Issue
Block a user