Skip to content

Commit

Permalink
bugfix: Add additional check for InterpolatorSplice substring
Browse files Browse the repository at this point in the history
  • Loading branch information
jkciesluk committed Mar 22, 2024
1 parent 33618c1 commit 50f95ae
Showing 1 changed file with 6 additions and 4 deletions.
Expand Up @@ -35,11 +35,13 @@ object InterpolationSplice {
}
}
if (isCandidate) {
val name = chars(i + 1) match {
case '{' => originalText.substring(i + 2, offset)
case _ => originalText.substring(i + 1, offset)
val nameOpt = chars(i + 1) match {
case '{' if i + 2 <= offset =>
Some(originalText.substring(i + 2, offset))
case _ if i + 1 <= offset => Some(originalText.substring(i + 1, offset))
case _ => None
}
Some(
nameOpt.map(name =>
InterpolationSplice(
i,
name,
Expand Down

0 comments on commit 50f95ae

Please sign in to comment.