mirror of
https://github.com/rkd77/elinks.git
synced 2024-11-04 08:17:17 -05: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:
parent
e092b6b08b
commit
54c33284fc
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user