[BCRSPattern][Bugfix] Fix detection code for empty rows