summaryrefslogtreecommitdiff
path: root/src/map/script.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/map/script.c')
-rw-r--r--src/map/script.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/map/script.c b/src/map/script.c
index 60f741d6c..f3bf2470a 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -2786,7 +2786,7 @@ void script_free_state(struct script_state* st)
script->pop_stack(st, 0, st->stack->sp);
aFree(st->stack->stack_data);
aFree(st->stack);
- if( st->script->script_vars && !db_size(st->script->script_vars) ) {
+ if( st->script && st->script->script_vars && !db_size(st->script->script_vars) ) {
script_free_vars(st->script->script_vars);
st->script->script_vars = NULL;
}