kittens: fix issue #73 missing undef check
kittens: fix issue #73 missing undef check

Forgot to check whether resource was undefined or not. Fix this by adding a
check to res first, and also explicitely check for undefined like we do in
other locations.

Signed-off-by: Jacob Keller <74ec1f46a68d238888726a00aa611ba6343172e2@gmail.com>

oliversalzburg/cbc-kitten-scientists,oliversalzburg/cbc-kitten-scientists,oliversalzburg/cbc-kitten-scientists,cameroncondry/cbc-kitten-scientists,rdancer/cbc-kitten-scientists