Skip to content

Commit 274fbd7

Browse files
author
Vitaliy
authored
Merge pull request magento#162 from magento/158-null-pointer-exception-on-indexer
Fixed null pointer exception
2 parents a4ba7d9 + 65b279d commit 274fbd7

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/com/magento/idea/magento2plugin/indexes/IndexManager.java

+6-5
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@
1414
import com.magento.idea.magento2plugin.stubs.indexes.mftf.*;
1515
import com.magento.idea.magento2plugin.stubs.indexes.xml.PhpClassNameIndex;
1616

17-
/**
18-
* Created by dkvashnin on 1/9/16.
19-
*/
2017
public class IndexManager {
2118
public static void manualReindex() {
2219
ID<?, ?>[] indexIds = new ID<?, ?>[] {
@@ -49,8 +46,12 @@ public static void manualReindex() {
4946
};
5047

5148
for (ID<?, ?> id: indexIds) {
52-
FileBasedIndexImpl.getInstance().requestRebuild(id);
53-
FileBasedIndexImpl.getInstance().scheduleRebuild(id, new Throwable());
49+
try {
50+
FileBasedIndexImpl.getInstance().requestRebuild(id);
51+
FileBasedIndexImpl.getInstance().scheduleRebuild(id, new Throwable());
52+
} catch (NullPointerException exception) {
53+
//that's fine, indexer is not present in map java.util.Map.get
54+
}
5455
}
5556
}
5657
}

0 commit comments

Comments
 (0)