not 100% sure, the code is:

    return (value && value->type == N_VALUE_TYPE_INT) ? value->value.i : 0;

I guess the first if(value && ...) fails, that should stop there and skip the pointer access, so it should work (and return 0) :)