Avoid Undefined index error due to empty criteria of "type = lookup"

I was issued a PR again after changing the branch.(Before #134)