Skip to content

Commit

Permalink
Check for empty strings in truncated PC match
Browse files Browse the repository at this point in the history
otherwize aStr.last() throw
  • Loading branch information
PrinsINT committed Jun 24, 2024
1 parent 5c054f7 commit 1eac0e0
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,9 @@ class LayerComparison(

companion object {
fun truncatedPcMatch(aStr: String, bStr: String): Boolean {
if (aStr.isEmpty() || bStr.isEmpty()) {
return false
}
if (PUNCTUATION.contains(aStr.last().toString())) {
if (aStr.slice(0 until aStr.lastIndex) == bStr) {
return true
Expand Down

0 comments on commit 1eac0e0

Please sign in to comment.