Skip to content

Commit d3689b8

Browse files
Vladimir Kotalahornace
authored andcommitted
do not attempt to set fields which cannot be set
1 parent 69d1f60 commit d3689b8

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

opengrok-web/src/main/java/org/opengrok/web/api/v1/controller/ProjectsController.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -311,13 +311,20 @@ public void set(
311311
// Set the property.
312312
ClassUtil.setFieldValue(project, field, value);
313313

314-
// Refresh repositories for this project as well.
314+
// Refresh field values for project's repositories for this project as well.
315315
List<RepositoryInfo> riList = env.getProjectRepositoriesMap().get(project);
316316
if (riList != null) {
317317
for (RepositoryInfo ri : riList) {
318318
Repository repo = getRepository(ri, CommandTimeoutType.RESTFUL);
319319

320-
// set the property
320+
// Set the property if there is one.
321+
try {
322+
ClassUtil.getFieldValue(repo, field);
323+
} catch (IOException e) {
324+
// ignore
325+
continue;
326+
}
327+
321328
ClassUtil.setFieldValue(repo, field, value);
322329
}
323330
}

0 commit comments

Comments
 (0)