Catch RuntimeException when there's no map

This fixes issue #129 for me. Of course, feel free to not revert the null check for the map if you still think it's necessary; it just didn't seem to help in my particular case.