mirror of
https://github.com/rkd77/elinks.git
synced 2025-06-30 22:19:29 -04:00
SMJS: bookmark_folder_get_property: Reflow some code.
Set the return value to JSVAL_NULL up front instead of in every error handling block.
This commit is contained in:
parent
ec1ab9fbe9
commit
1a3b718f98
@ -165,19 +165,13 @@ bookmark_folder_get_property(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
|
|||||||
struct bookmark *folder = JS_GetPrivate(ctx, obj);
|
struct bookmark *folder = JS_GetPrivate(ctx, obj);
|
||||||
unsigned char *title;
|
unsigned char *title;
|
||||||
|
|
||||||
title = JS_GetStringBytes(JS_ValueToString(ctx, id));
|
*vp = JSVAL_NULL;
|
||||||
if (!title) {
|
|
||||||
*vp = JSVAL_NULL;
|
|
||||||
|
|
||||||
return JS_TRUE;
|
title = JS_GetStringBytes(JS_ValueToString(ctx, id));
|
||||||
}
|
if (!title) return JS_TRUE;
|
||||||
|
|
||||||
bookmark = get_bookmark_by_name(folder, title);
|
bookmark = get_bookmark_by_name(folder, title);
|
||||||
if (!bookmark) {
|
if (!bookmark) return JS_TRUE;
|
||||||
*vp = JSVAL_NULL;
|
|
||||||
|
|
||||||
return JS_TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
*vp = OBJECT_TO_JSVAL(smjs_get_bookmark_object(bookmark));
|
*vp = OBJECT_TO_JSVAL(smjs_get_bookmark_object(bookmark));
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user