Skip to content

Commit 2b39dde

Browse files
authored
Merge pull request #1213 from Mgonzalez-droid/4.4.1-develop-add-NPE-check-2
1206: Covered possible NullPointerException in InjectAViewModelDialog.java
2 parents f3f7cfd + f627f33 commit 2b39dde

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0).
1010

1111
- Throwable: Stub index points to a file without PSI [#1232](https://github.com/magento/magento2-phpstorm-plugin/pull/1232)
1212
- Create an entity - delete button is displayed in a new entity form [#1268](https://github.com/magento/magento2-phpstorm-plugin/pull/1268)
13+
- Covered possible NullPointerException in InjectAViewModelDialog.java [#1213](https://github.com/magento/magento2-phpstorm-plugin/pull/1213)
1314

1415
## 5.0.0
1516

src/com/magento/idea/magento2plugin/actions/generation/dialog/InjectAViewModelDialog.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,12 @@ protected void onOK() {
141141
exit();
142142
return;
143143
}
144+
145+
if (targetBlockTag.getContainingFile() == null
146+
|| targetBlockTag.getContainingFile().getParent() == null) {
147+
return;
148+
}
149+
144150
final String moduleName = GetModuleNameByDirectoryUtil.execute(
145151
targetBlockTag.getContainingFile().getParent(),
146152
project

0 commit comments

Comments
 (0)