Bug 893222 - Part 0: Make JSRope::getCharsNonDestructiveInternal work with a null tcx. r=bhackett

This commit is contained in:
Justin Lebar 2013-08-05 16:33:00 -07:00
parent 57186da9cf
commit 34e006b755

View File

@ -185,7 +185,12 @@ JSRope::getCharsNonDestructiveInternal(ThreadSafeContext *cx, ScopedJSFreePtr<js
*/
size_t n = length();
jschar *s = cx->pod_malloc<jschar>(n + 1);
jschar *s;
if (cx)
s = cx->pod_malloc<jschar>(n + 1);
else
s = js_pod_malloc<jschar>(n + 1);
if (!s)
return false;
jschar *pos = s;