From 303f8daaf9c66742ffb6d3ab33518d183cbdf329 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Pfeuffer?= Date: Thu, 19 May 2022 08:36:25 +0200 Subject: [PATCH] Fix NPE on synchronous repository export (#2040) When a repository was exported synchronously with metadata, the server ran into a NullPointerException. The was because the resource tried to write an export result to a stored export item, that does not exist for synchronous exports. This simply removes this call. --- gradle/changelog/npe_on_export.yaml | 2 ++ .../sonia/scm/api/v2/resources/RepositoryExportResource.java | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) create mode 100644 gradle/changelog/npe_on_export.yaml diff --git a/gradle/changelog/npe_on_export.yaml b/gradle/changelog/npe_on_export.yaml new file mode 100644 index 0000000000..07a2e0db6f --- /dev/null +++ b/gradle/changelog/npe_on_export.yaml @@ -0,0 +1,2 @@ +- type: fixed + description: NPE on synchronous repository export ([#2040](https://github.com/scm-manager/scm-manager/pull/2040)) diff --git a/scm-webapp/src/main/java/sonia/scm/api/v2/resources/RepositoryExportResource.java b/scm-webapp/src/main/java/sonia/scm/api/v2/resources/RepositoryExportResource.java index 9ea9d0e3ed..5115ae4487 100644 --- a/scm-webapp/src/main/java/sonia/scm/api/v2/resources/RepositoryExportResource.java +++ b/scm-webapp/src/main/java/sonia/scm/api/v2/resources/RepositoryExportResource.java @@ -457,8 +457,6 @@ public class RepositoryExportResource { return Response.status(204).build(); } else { StreamingOutput output = os -> fullScmRepositoryExporter.export(repository, os, password); - exportService.setExportFinished(repository); - return Response .ok(output, "application/x-gzip") .header("content-disposition", createContentDispositionHeaderValue(repository, fileExtension))