File tree 2 files changed +22
-8
lines changed
src/com/magento/idea/magento2plugin/inspections/xml 2 files changed +22
-8
lines changed Original file line number Diff line number Diff line change @@ -100,6 +100,10 @@ public void visitFile(final PsiFile file) {
100
100
}
101
101
102
102
final String observerName = observerNameAttribute .getValue ();
103
+ if (observerName == null ) {
104
+ continue ;
105
+ }
106
+
103
107
final String observerKey = eventNameAttributeValue .concat ("_" )
104
108
.concat (observerName );
105
109
if (targetObserversHash .containsKey (observerKey )) {
@@ -124,10 +128,13 @@ public void visitFile(final PsiFile file) {
124
128
if (observerDisabledAttribute != null
125
129
&& observerDisabledAttribute .getValue () != null
126
130
&& observerDisabledAttribute .getValue ().equals ("true" )
131
+ && !observerName .isEmpty ()
127
132
) {
128
- if (modulesWithSameObserverName .isEmpty ()) {
133
+ @ Nullable final XmlAttributeValue valueElement
134
+ = observerNameAttribute .getValueElement ();
135
+ if (modulesWithSameObserverName .isEmpty () && valueElement != null ) {
129
136
problemsHolder .registerProblem (
130
- observerNameAttribute . getValueElement () ,
137
+ valueElement ,
131
138
inspectionBundle .message (
132
139
"inspection.observer.disabledObserverDoesNotExist"
133
140
),
Original file line number Diff line number Diff line change @@ -93,6 +93,10 @@ public void visitFile(final PsiFile file) {
93
93
}
94
94
95
95
final String pluginTypeName = pluginTypeNameAttribute .getValue ();
96
+ if (pluginTypeName == null ) {
97
+ continue ;
98
+ }
99
+
96
100
final String pluginTypeKey = pluginNameAttributeValue .concat (
97
101
Package .vendorModuleNameSeparator
98
102
).concat (pluginTypeName );
@@ -118,14 +122,17 @@ public void visitFile(final PsiFile file) {
118
122
if (pluginTypeDisabledAttribute != null
119
123
&& pluginTypeDisabledAttribute .getValue () != null
120
124
&& pluginTypeDisabledAttribute .getValue ().equals ("true" )
125
+ && !pluginTypeName .isEmpty ()
121
126
) {
122
- if (modulesWithSamePluginName .isEmpty ()) {
127
+ @ Nullable final XmlAttributeValue valueElement
128
+ = pluginTypeNameAttribute .getValueElement ();
129
+ if (modulesWithSamePluginName .isEmpty () && valueElement != null ) {
123
130
problemsHolder .registerProblem (
124
- pluginTypeNameAttribute . getValueElement () ,
125
- inspectionBundle .message (
126
- "inspection.plugin.disabledPluginDoesNotExist"
127
- ),
128
- errorSeverity
131
+ valueElement ,
132
+ inspectionBundle .message (
133
+ "inspection.plugin.disabledPluginDoesNotExist"
134
+ ),
135
+ errorSeverity
129
136
);
130
137
} else {
131
138
continue ;
You can’t perform that action at this time.
0 commit comments