File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
src/main/kotlin/de/rakhman/angular_split_buttons Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -15,10 +15,10 @@ abstract class AbstractOpenAngularAction : AnAction() {
15
15
abstract val extensions: Map <String , Icon >
16
16
17
17
override fun update (e : AnActionEvent ) {
18
- val file = e.getData(CommonDataKeys .PSI_FILE )!!
19
- val sibling = getSibling(file)
18
+ val file = e.getData(CommonDataKeys .PSI_FILE )
19
+ val sibling = file?. let { getSibling(it) }
20
20
21
- e.presentation.isEnabledAndVisible = ! hasMatchingExtension( file) && sibling != null
21
+ e.presentation.isEnabledAndVisible = file != null && sibling != null && ! hasMatchingExtension(file)
22
22
e.presentation.text = " Open ${sibling?.name} "
23
23
e.presentation.icon = sibling?.name?.substringAfterLast(" ." )?.let {
24
24
extensions[it.lowercase()]
You can’t perform that action at this time.
0 commit comments