guard against undefined
simplify guard.
fixes strider #228 https://github.com/Strider-CD/strider/issues/228