Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NPE in BlockStructureBraces #502

Merged
merged 4 commits into from
Nov 16, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,9 @@ class BlockStructureBraces(private val configRules: List<RulesConfig>) : Rule("b
if (braceSpace == null || braceSpace.elementType != WHITE_SPACE) {
node.addChild(PsiWhiteSpaceImpl(" "), nodeBefore)
} else {
(braceSpace as LeafPsiElement).replaceWithText(" ")
val spaceParent = braceSpace.treeParent
spaceParent.addChild(PsiWhiteSpaceImpl(" "), braceSpace)
spaceParent.removeChild(braceSpace)
kentr0w marked this conversation as resolved.
Show resolved Hide resolved
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,13 @@ fun mains() {
httpClient.doRequest()
}

class Example {
fun foo() {
if (condition1) {
if (condition2) {
bar()
}
}
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,12 @@ fun mains() {
timeout = 100
}
httpClient.doRequest()
}
}

class Example {
fun foo() {
if (condition1)
if (condition2)
bar()
}
}