WEB-24362 JSON Schema: NullPointerException is thrown on saving changes in the schema in use.

This commit is contained in:
irengrig
2016-11-25 16:09:57 +01:00
parent 9c577d1709
commit 1cdb2d07bf
@@ -58,7 +58,7 @@ public class JsonSchemaVfsListener extends BulkVirtualFileListenerAdapter {
for (Editor editor : editors) {
if (editor instanceof EditorEx) {
final VirtualFile file = ((EditorEx)editor).getVirtualFile();
if (JsonFileType.INSTANCE.equals(file.getFileType())) {
if (file != null && file.isValid() && JsonFileType.INSTANCE.equals(file.getFileType())) {
final Collection<Pair<VirtualFile, String>> collection = myService.getSchemaFilesByFile(file);
if (collection != null && !collection.isEmpty()) {
for (Pair<VirtualFile, String> pair : collection) {