mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
SMJS: Fix crash with elinks.vs and no document loaded
Make sure that there really is a view_state before creating a wrapper object with a bad pointer for it.
This commit is contained in:
parent
5899c281ce
commit
52bd1ea01b
@ -120,7 +120,7 @@ smjs_elinks_get_view_state(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
|
||||
|
||||
*vp = JSVAL_NULL;
|
||||
|
||||
if (!smjs_ses) return JS_TRUE;
|
||||
if (!smjs_ses || !have_location(smjs_ses)) return JS_TRUE;
|
||||
|
||||
vs = &cur_loc(smjs_ses)->vs;
|
||||
if (!vs) return JS_TRUE;
|
||||
|
Loading…
Reference in New Issue
Block a user