From acc2da023c640045f7f431156868e9d8ef75be2c Mon Sep 17 00:00:00 2001 From: Thilo Schulz Date: Tue, 27 Sep 2011 21:17:21 +0000 Subject: [PATCH] Throw error when making calls to empty VM --- code/qcommon/vm.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/code/qcommon/vm.c b/code/qcommon/vm.c index c500aea6..ba9886cd 100644 --- a/code/qcommon/vm.c +++ b/code/qcommon/vm.c @@ -765,14 +765,14 @@ locals from sp ============== */ -intptr_t QDECL VM_Call( vm_t *vm, int callnum, ... ) { +intptr_t QDECL VM_Call( vm_t *vm, int callnum, ... ) +{ vm_t *oldVM; intptr_t r; int i; - if ( !vm ) { - Com_Error( ERR_FATAL, "VM_Call with NULL vm" ); - } + if(!vm || !vm->name[0]) + Com_Error(ERR_FATAL, "VM_Call with NULL vm"); oldVM = currentVM; currentVM = vm;