snippets: fix error trying to use variable that is not assigned