File tree Expand file tree Collapse file tree 1 file changed +18
-4
lines changed
src/com/magento/idea/magento2plugin/stubs/indexes Expand file tree Collapse file tree 1 file changed +18
-4
lines changed Original file line number Diff line number Diff line change @@ -96,11 +96,10 @@ private Set<PluginData> getPluginsForType(final XmlTag typeNode) {
9696
9797 for (final XmlTag pluginTag : typeNode .findSubTags (ModuleDiXml .PLUGIN_TAG_NAME )) {
9898 final String pluginType = pluginTag .getAttributeValue (ModuleDiXml .TYPE_ATTR );
99- String pluginSortOrder = pluginTag .getAttributeValue (ModuleDiXml .SORT_ORDER_ATTR );
99+ final String pluginSortOrder = pluginTag .getAttributeValue (ModuleDiXml .SORT_ORDER_ATTR );
100100
101101 if (pluginType != null && !pluginType .isEmpty ()) {
102- pluginSortOrder = pluginSortOrder == null ? "0" : pluginSortOrder ;
103- final PluginData pluginData = getPluginDataObject (pluginType , Integer .parseInt (pluginSortOrder ));
102+ final PluginData pluginData = getPluginDataObject (pluginType , getIntegerOrZeroValue (pluginSortOrder ));
104103 try {
105104 phpIndex .getAnyByFQN (pluginData .getType ());
106105 results .add (pluginData );
@@ -113,7 +112,22 @@ private Set<PluginData> getPluginsForType(final XmlTag typeNode) {
113112 return results ;
114113 }
115114
116- private PluginData getPluginDataObject (final String pluginType , final Integer sortOrder ) {
115+ private Integer getIntegerOrZeroValue (final String sortOrder ) {
116+ if (sortOrder == null || sortOrder .isEmpty ()) {
117+ return 0 ;
118+ }
119+
120+ try {
121+ return Integer .parseInt (sortOrder );
122+ } catch (NumberFormatException e ) {
123+ return 0 ;
124+ }
125+ }
126+
127+ private PluginData getPluginDataObject (
128+ final String pluginType ,
129+ final Integer sortOrder
130+ ) {
117131 return new PluginData (pluginType , sortOrder );
118132 }
119133 };
You can’t perform that action at this time.
0 commit comments