[Community Backup & Restore] Local Resource Finder on Restore does not check if File is null

Description

During a Restore, when looking for plugins specific configurations, while trying to replace the target tile GeoServer task looks for any already existing resource of the same type

Resource rstConfigFile = Files.asResource(resourceLoader.find(
Paths.path(
configFile.file().getParentFile().getName(),
configFile.file().getName())));

If it already exists, it replaces it, otherwise it just write the new configuration file.

The issue pops up if the resource does not exist, find returns NULL (the most of the times).

In that case the asResource method just throws an exception, breaking the whole process.

Solutions is simple, we should check that .file does not return a null path.

Environment

None

Status

Assignee

Alessio Fabiani

Reporter

Alessio Fabiani

Triage

None

Fix versions

Affects versions

2.13.1
2.14-RC

Priority

Medium
Configure