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.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/map/script.c b/src/map/script.c
index e439f44c2..bf0d5e780 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -4365,6 +4365,10 @@ int buildin_strcharinfo(struct script_state *st)
int num;
sd=script_rid2sd(st);
+ if (!sd) { //Avoid crashing....
+ push_str(st->stack,C_CONSTSTR,(unsigned char *) "");
+ return 0;
+ }
num=conv_num(st,& (st->stack->stack_data[st->start+2]));
if(sd){
switch(num){