Don't crash on error when nil is passed as error parameter