Fixed missing variable checks

Fixes the issue reported by commit 0dc620263460887bcc33bc8eaa5738be0a2b7e04
Signed-off-by: jdarwood007 <github+smf@sleepycode.com>