Bug 1481225: Avoid confusing console spam on native app shutdown. r=aswan
authorKris Maglione <maglione.k@gmail.com>
Thu, 16 Aug 2018 11:13:36 -0700
changeset 487120 9e05198aa74aa76790001aa403d6d7e33b49f9dd
parent 487119 d742e378449f13dc005440257debc98068381c96
child 487121 72442cf86f54cfd48f15ff2f3c8a926e7d078c13
child 487155 7400a9b3fb353b21b5a25b9927e14bb348335625
push id9719
push userffxbld-merge
push dateFri, 24 Aug 2018 17:49:46 +0000
treeherdermozilla-beta@719ec98fba77 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersaswan
bugs1481225
milestone63.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1481225: Avoid confusing console spam on native app shutdown. r=aswan Differential Revision: https://phabricator.services.mozilla.com/D3540
toolkit/components/extensions/NativeMessaging.jsm
--- a/toolkit/components/extensions/NativeMessaging.jsm
+++ b/toolkit/components/extensions/NativeMessaging.jsm
@@ -246,17 +246,19 @@ var NativeApp = class extends EventEmitt
   // that the connect has been disconnected.
   _cleanup(err) {
     this.context.forgetOnClose(this);
 
     let doCleanup = () => {
       // Set a timer to kill the process gracefully after one timeout
       // interval and kill it forcefully after two intervals.
       let timer = setTimeout(() => {
-        this.proc.kill(GRACEFUL_SHUTDOWN_TIME);
+        if (this.proc) {
+          this.proc.kill(GRACEFUL_SHUTDOWN_TIME);
+        }
       }, GRACEFUL_SHUTDOWN_TIME);
 
       let promise = Promise.all([
         this.proc.stdin.close()
           .catch(err => {
             if (err.errorCode != Subprocess.ERROR_END_OF_FILE) {
               throw err;
             }