I've added some defensive code which should at least prevent the crash (though it does nothing for the underlying cause).
I've added some defensive code which should at least prevent the crash (though it does nothing for the underlying cause).