summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authorepoque11 <epoque11@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-04-29 11:40:20 +0000
committerepoque11 <epoque11@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-04-29 11:40:20 +0000
commite177342cd0bd69313de720e5d42ffebe33b46e05 (patch)
tree8e21bcfa8a9f499444de2a71a20bfe15ce33585f /src/map
parent3c2af91fc8161df26a82a8d8d32cc54565bbe839 (diff)
downloadhercules-e177342cd0bd69313de720e5d42ffebe33b46e05.tar.gz
hercules-e177342cd0bd69313de720e5d42ffebe33b46e05.tar.bz2
hercules-e177342cd0bd69313de720e5d42ffebe33b46e05.tar.xz
hercules-e177342cd0bd69313de720e5d42ffebe33b46e05.zip
- Fixed a map-server crash when script variable storage reference is NULL (bugreport:5666)
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16002 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map')
-rw-r--r--src/map/script.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/map/script.c b/src/map/script.c
index 856b2d95e..ad239ddcd 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -2537,7 +2537,10 @@ void get_val(struct script_state* st, struct script_data* data)
data->ref ? *data->ref:
name[1] == '@' ? st->stack->var_function:// instance/scope variable
st->script->script_vars;// npc variable
- data->u.str = (char*)idb_get(n,reference_getuid(data));
+ if( n )
+ data->u.str = (char*)idb_get(n,reference_getuid(data));
+ else
+ data->u.str = NULL;
}
break;
case '\'':
@@ -2599,7 +2602,10 @@ void get_val(struct script_state* st, struct script_data* data)
data->ref ? *data->ref:
name[1] == '@' ? st->stack->var_function:// instance/scope variable
st->script->script_vars;// npc variable
- data->u.num = (int)idb_iget(n,reference_getuid(data));
+ if( n )
+ data->u.num = (int)idb_iget(n,reference_getuid(data));
+ else
+ data->u.num = 0;
}
break;
case '\'':