fix bug 1044068 - Prevent 'Cannot call execute of null' errors

This is a working PR and should be treated as such.  Likely lots of conversation below.

Still to complete:

- [x] - A test to confirm my PR prevents the issue.
I'm still wondering if I'm doing some slight cheating here.  Will continue to investigate.