Check for existence of patched client -> prevents stack overflow

Fixes potential stack overflow from reapplying a function over and over.