break loop if can't find object

Infinite loop when the patches array contained an invalid JSON path