mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
cache_entry_get_property: fix assertion failure
In cache_entry_get_property, don't assert the return value from get_cache_fragment; instead, just return JS_FALSE if the value is NULL.
This commit is contained in:
parent
da209c6b6f
commit
a3918d8c30
@ -72,7 +72,10 @@ cache_entry_get_property(JSContext *ctx, JSObject *obj, jsid id, jsval *vp)
|
|||||||
case CACHE_ENTRY_CONTENT: {
|
case CACHE_ENTRY_CONTENT: {
|
||||||
struct fragment *fragment = get_cache_fragment(cached);
|
struct fragment *fragment = get_cache_fragment(cached);
|
||||||
|
|
||||||
assert(fragment);
|
if (!fragment) {
|
||||||
|
ret = JS_FALSE;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
*vp = STRING_TO_JSVAL(JS_NewStringCopyN(smjs_ctx,
|
*vp = STRING_TO_JSVAL(JS_NewStringCopyN(smjs_ctx,
|
||||||
fragment->data,
|
fragment->data,
|
||||||
|
Loading…
Reference in New Issue
Block a user