Fix for issue #41

Added a "&&" short-circuit check so no null/undefined reference error accrues.