diff --git a/ReactAndroid/src/main/jni/react/JSCHelpers.cpp b/ReactAndroid/src/main/jni/react/JSCHelpers.cpp index 0711c273f..b18e965c6 100644 --- a/ReactAndroid/src/main/jni/react/JSCHelpers.cpp +++ b/ReactAndroid/src/main/jni/react/JSCHelpers.cpp @@ -55,7 +55,7 @@ JSValueRef evaluateScript(JSContextRef context, JSStringRef script, JSStringRef auto line = exception.asObject().getProperty("line"); std::ostringstream locationInfo; - std::string file = source != nullptr ? String::adopt(source).str() : ""; + std::string file = source != nullptr ? String::ref(source).str() : ""; locationInfo << "(" << (file.length() ? file : ""); if (line != nullptr && line.isNumber()) { locationInfo << ":" << line.asInteger();