Fix invalid variable on resource/getlist

(cherry picked from commit 9c55425318d4bb083da4069cfcaf0a11a9d81b46)