fixed #100: test for None before invoking function on object