diff --git a/C/load_foreign.c b/C/load_foreign.c index 13c86b782..ead46aa76 100755 --- a/C/load_foreign.c +++ b/C/load_foreign.c @@ -261,7 +261,8 @@ Yap_ReOpenLoadForeign(void) while (f_code != NULL) { CurrentModule = f_code->module; if(Yap_ReLoadForeign(f_code->objs,f_code->libs,f_code->f,&InitProc)==LOAD_SUCCEEDED) { - (*InitProc)(); + if (InitProc) + (*InitProc)(); } f_code = f_code->next; }