diff --git a/base/src/com/google/idea/blaze/base/settings/Blaze.java b/base/src/com/google/idea/blaze/base/settings/Blaze.java index d6534006bc6..5ba950873e7 100644 --- a/base/src/com/google/idea/blaze/base/settings/Blaze.java +++ b/base/src/com/google/idea/blaze/base/settings/Blaze.java @@ -98,6 +98,12 @@ public static ProjectType getUpToDateProjectTypeBeforeSync(@Nonnull Project proj context -> { return ProjectViewManager.getInstance(project).reloadProjectView(context); }); + + if (projectViewSet == null) { + // fallback existing type if project view file is not valid + return blazeImportSettings.getProjectType(); + } + Optional querySyncProjectView = projectViewSet.getScalarValue(UseQuerySyncSection.KEY); if (querySyncProjectView.isPresent()) { if (blazeImportSettings.getProjectType() == ProjectType.QUERY_SYNC && !querySyncProjectView.get()) {