[core] fix getParagraphWithErrors when no errors