Fix for issue #4730 - stacktrace when deferenencing a non-existent group

Added exception handling for bug reported in issue #4730. My first pull request so I apologize if it is a little messy.