Skip to content

Commit ca74b0f

Browse files
authored
Merge pull request #2606 from vitaliyboykocontributor/2602-java.lang.IllegalArgumentException
Handle null PsiDirectory input in GetModuleNameByDirectoryUtil.
2 parents 60e2926 + e562302 commit ca74b0f

File tree

4 files changed

+13
-3
lines changed

4 files changed

+13
-3
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
44

55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0).
66

7+
## 2025.2.2
8+
9+
### Fixed
10+
11+
- Null PsiDirectory input in GetModuleNameByDirectoryUtil [#2606](https://github.com/magento/magento2-phpstorm-plugin/pull/2606)
12+
713
## 2025.2.1
814

915
### Fixed

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
pluginGroup = com.magento.idea.magento2plugin
22
pluginName = Magento PhpStorm
33
pluginRepositoryUrl = https://github.com/magento/magento2-phpstorm-plugin
4-
pluginVersion = 2025.2.1
4+
pluginVersion = 2025.2.2
55
pluginSinceBuild = 250.*
66
pluginUntilBuild = 258.*
77
platformType = PS

src/main/java/com/magento/idea/magento2plugin/util/magento/GetModuleNameByDirectoryUtil.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,13 @@ private GetModuleNameByDirectoryUtil() {}
3232
* @return String
3333
*/
3434
public static @Nullable String execute(
35-
final @NotNull PsiDirectory psiDirectory,
35+
final @Nullable PsiDirectory psiDirectory,
3636
final @NotNull Project project
3737
) {
38+
// Gracefully handle null directory inputs from callers
39+
if (psiDirectory == null) {
40+
return null;
41+
}
3842
// Check if directory is theme directory and return module name from directory path if yes
3943
final String path = psiDirectory.getVirtualFile().getPath();
4044
final Pattern pattern = Pattern.compile(RegExUtil.CustomTheme.MODULE_NAME);

src/main/resources/META-INF/plugin.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<idea-plugin require-restart="true">
88
<id>com.magento.idea.magento2plugin</id>
99
<name>Magento PhpStorm</name>
10-
<version>2025.2.1</version>
10+
<version>2025.2.2</version>
1111
<vendor url="https://github.com/magento/magento2-phpstorm-plugin">Magento Inc.</vendor>
1212

1313
<description><![CDATA[

0 commit comments

Comments
 (0)