Fixed exception when trying to export an empty entity list

Fixes issue #836
This commit is contained in:
Jan Böhmer 2025-02-01 20:57:27 +01:00
parent fd7a0156bc
commit aa06e1df04
3 changed files with 14 additions and 2 deletions

View file

@ -112,8 +112,9 @@ class PartImportExportController extends AbstractController
$ids = $request->query->get('ids', '');
$parts = $this->partsTableActionHandler->idStringToArray($ids);
if ($parts === []) {
throw new \RuntimeException('No parts found!');
if (count($parts) === 0) {
$this->addFlash('error', 'entity.export.flash.error.no_entities');
return $this->redirectToRoute('homepage');
}
//Ensure that we have access to the parts