1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-06-28 01:35:32 +00:00

elinks_get_property: return empty string if no URI

For the elinks.location property, if elinks_get_property fails to find
a URI, just return the empty string rather than returning an error.
This commit is contained in:
Miciah Dashiel Butler Masters 2011-11-13 05:38:15 +00:00
parent e092b6b08b
commit 54c33284fc

View File

@ -127,9 +127,9 @@ elinks_get_property(JSContext *ctx, JSObject *obj, jsid id, jsval *vp)
uri = have_location(smjs_ses) ? cur_loc(smjs_ses)->vs.uri
: smjs_ses->loading_uri;
if (!uri) return JS_FALSE;
*vp = STRING_TO_JSVAL(JS_NewStringCopyZ(smjs_ctx, struri(uri)));
*vp = STRING_TO_JSVAL(JS_NewStringCopyZ(smjs_ctx,
uri ? (const char *) struri(uri) : ""));
return JS_TRUE;
}