1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-11-04 08:17:17 -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:
Miciah Dashiel Butler Masters 2011-11-13 04:06:42 +00:00
parent da209c6b6f
commit a3918d8c30

View File

@ -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,