Skip to content

Commit

Permalink
handle non-valid project view file on reload (#7159)
Browse files Browse the repository at this point in the history
stick to the existing project type if project view
is not valid

fixes #7155
  • Loading branch information
ujohnny authored Dec 16, 2024
1 parent ddff24e commit b14a8b2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions base/src/com/google/idea/blaze/base/settings/Blaze.java
Original file line number Diff line number Diff line change
Expand Up @@ -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<Boolean> querySyncProjectView = projectViewSet.getScalarValue(UseQuerySyncSection.KEY);
if (querySyncProjectView.isPresent()) {
if (blazeImportSettings.getProjectType() == ProjectType.QUERY_SYNC && !querySyncProjectView.get()) {
Expand Down

0 comments on commit b14a8b2

Please sign in to comment.