Merge "Fix 3409550: Fix crash caused when max pattern attempts met."