Fix potential segfault

GET_VARIABLE can return NULL.