Code cleanup: replace chained null-checks with safe-calls

This commit is contained in:
Mikhail Glukhikh
2017-07-11 16:35:04 +03:00
committed by Mikhail Glukhikh
parent 732d1129ab
commit 7fb78a0372
12 changed files with 12 additions and 13 deletions
@@ -73,7 +73,7 @@ abstract class AndroidLayoutXmlFileManager(val project: Project) {
val allLayoutFiles = allChildren.filter { it.parent.name.startsWith("layout") && it.name.toLowerCase().endsWith(".xml") }
val allLayoutPsiFiles = allLayoutFiles.fold(ArrayList<PsiFile>(allLayoutFiles.size)) { list, file ->
val psiFile = psiManager.findFile(file)
if (psiFile != null && psiFile.parent != null) {
if (psiFile?.parent != null) {
list += psiFile
}
list