diff --git a/dom/system/nsDeviceMotion.cpp b/dom/system/nsDeviceMotion.cpp index c98b97e9edf2..b59e4b4e796a 100644 --- a/dom/system/nsDeviceMotion.cpp +++ b/dom/system/nsDeviceMotion.cpp @@ -202,7 +202,7 @@ NS_IMETHODIMP nsDeviceMotion::AddWindowListener(nsIDOMWindow *aWindow) mStarted = PR_TRUE; Startup(); } - if (mWindowListeners.IndexOf(aWindow) != NoIndex) + if (mWindowListeners.IndexOf(aWindow) == NoIndex) mWindowListeners.AppendElement(aWindow); return NS_OK; }