Skip to content

Commit

Permalink
Merge pull request #13525 from wordpress-mobile/fix/stories-stringind…
Browse files Browse the repository at this point in the history
…exoutofbounds

Stories: Fix StringIndexOutOfBoundsException when below another block
  • Loading branch information
mzorz authored Dec 3, 2020
2 parents 4101525 + 1f43fd9 commit 430d39f
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,10 @@ class SaveStoryGutenbergBlockUseCase @Inject constructor(
while (storyBlockStartIndex > -1 && storyBlockStartIndex < content.length) {
storyBlockStartIndex = content.indexOf(HEADING_START, storyBlockStartIndex)
if (storyBlockStartIndex > -1) {
val storyBlockEndIndex = content.indexOf(HEADING_END, storyBlockStartIndex)
val jsonString: String = content.substring(
storyBlockStartIndex + HEADING_START.length,
content.indexOf(HEADING_END))
storyBlockEndIndex)
content = listener.doWithMediaFilesJson(content, jsonString)
storyBlockStartIndex += HEADING_START.length
}
Expand Down

0 comments on commit 430d39f

Please sign in to comment.