From: Mike Hommey <mh@glandium.org>
Date: Mon, 1 Feb 2010 13:31:52 +0100
Subject: Avoid crashing when trying to kill a nsProcess that is already terminated

https://bugzilla.mozilla.org/show_bug.cgi?id=543441
---
 xpcom/threads/nsProcessCommon.cpp |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xpcom/threads/nsProcessCommon.cpp b/xpcom/threads/nsProcessCommon.cpp
index de12bc4..e31b1de 100644
--- a/xpcom/threads/nsProcessCommon.cpp
+++ b/xpcom/threads/nsProcessCommon.cpp
@@ -516,7 +516,7 @@ nsProcess::Kill()
         if (TerminateProcess(mProcess, NULL) == 0)
             return NS_ERROR_FAILURE;
 #else
-        if (PR_KillProcess(mProcess) != PR_SUCCESS)
+        if (!mProcess || (PR_KillProcess(mProcess) != PR_SUCCESS))
             return NS_ERROR_FAILURE;
 #endif
     }
