File tree Expand file tree Collapse file tree 2 files changed +22
-8
lines changed
src/com/magento/idea/magento2plugin/inspections/xml Expand file tree Collapse file tree 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) {
100100 }
101101
102102 final String observerName = observerNameAttribute .getValue ();
103+ if (observerName == null ) {
104+ continue ;
105+ }
106+
103107 final String observerKey = eventNameAttributeValue .concat ("_" )
104108 .concat (observerName );
105109 if (targetObserversHash .containsKey (observerKey )) {
@@ -124,10 +128,13 @@ public void visitFile(final PsiFile file) {
124128 if (observerDisabledAttribute != null
125129 && observerDisabledAttribute .getValue () != null
126130 && observerDisabledAttribute .getValue ().equals ("true" )
131+ && !observerName .isEmpty ()
127132 ) {
128- if (modulesWithSameObserverName .isEmpty ()) {
133+ @ Nullable final XmlAttributeValue valueElement
134+ = observerNameAttribute .getValueElement ();
135+ if (modulesWithSameObserverName .isEmpty () && valueElement != null ) {
129136 problemsHolder .registerProblem (
130- observerNameAttribute . getValueElement () ,
137+ valueElement ,
131138 inspectionBundle .message (
132139 "inspection.observer.disabledObserverDoesNotExist"
133140 ),
Original file line number Diff line number Diff line change @@ -93,6 +93,10 @@ public void visitFile(final PsiFile file) {
9393 }
9494
9595 final String pluginTypeName = pluginTypeNameAttribute .getValue ();
96+ if (pluginTypeName == null ) {
97+ continue ;
98+ }
99+
96100 final String pluginTypeKey = pluginNameAttributeValue .concat (
97101 Package .vendorModuleNameSeparator
98102 ).concat (pluginTypeName );
@@ -118,14 +122,17 @@ public void visitFile(final PsiFile file) {
118122 if (pluginTypeDisabledAttribute != null
119123 && pluginTypeDisabledAttribute .getValue () != null
120124 && pluginTypeDisabledAttribute .getValue ().equals ("true" )
125+ && !pluginTypeName .isEmpty ()
121126 ) {
122- if (modulesWithSamePluginName .isEmpty ()) {
127+ @ Nullable final XmlAttributeValue valueElement
128+ = pluginTypeNameAttribute .getValueElement ();
129+ if (modulesWithSamePluginName .isEmpty () && valueElement != null ) {
123130 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
129136 );
130137 } else {
131138 continue ;
You can’t perform that action at this time.
0 commit comments