Commit c9c3c42c authored by Matthew Gaudet's avatar Matthew Gaudet
Browse files

Bug 1860193 - Verify we get a script from a function before asking for the...

Bug 1860193 - Verify we get a script from a function before asking for the filename r=mccr8, a=RyanVM

Differential Revision: https://phabricator.services.mozilla.com/D203836
parent 9f87b3b2
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1789,7 +1789,7 @@ nsXPCComponents_Utils::GetFunctionSourceLocation(HandleValue funcValue,
    NS_ENSURE_TRUE(func, NS_ERROR_INVALID_ARG);

    RootedScript script(cx, JS_GetFunctionScript(cx, func));
    NS_ENSURE_TRUE(func, NS_ERROR_FAILURE);
    NS_ENSURE_TRUE(script, NS_ERROR_FAILURE);

    AppendUTF8toUTF16(nsDependentCString(JS_GetScriptFilename(script)),
                      filename);