1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-10-01 03:36:26 -04: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:
Miciah Dashiel Butler Masters 2006-06-11 02:33:41 +00:00 committed by Miciah Dashiel Butler Masters
parent 5899c281ce
commit 52bd1ea01b

View File

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