From d0f2f7869872a87997b55c2de56af2446f5b6650 Mon Sep 17 00:00:00 2001 From: "Scott E. Graves" Date: Sat, 15 Mar 2025 18:14:21 -0500 Subject: [PATCH] handle mount location not found --- repertory/repertory/src/ui/handlers.cpp | 4 ++++ web/repertory/lib/helpers.dart | 2 ++ 2 files changed, 6 insertions(+) diff --git a/repertory/repertory/src/ui/handlers.cpp b/repertory/repertory/src/ui/handlers.cpp index 370351df..824c80bd 100644 --- a/repertory/repertory/src/ui/handlers.cpp +++ b/repertory/repertory/src/ui/handlers.cpp @@ -323,6 +323,10 @@ void handlers::handle_post_mount(auto &&req, auto &&res) const { if (unmount) { launch_process(prov, name, "-unmount"); } else { + if (not utils::file::directory{location}.exists()) { + res.status = http_error_codes::internal_error; + } + launch_process(prov, name, fmt::format(R"("{}")", location), true); } diff --git a/web/repertory/lib/helpers.dart b/web/repertory/lib/helpers.dart index db75adba..2ab37fd4 100644 --- a/web/repertory/lib/helpers.dart +++ b/web/repertory/lib/helpers.dart @@ -127,6 +127,8 @@ List getSettingValidators(String settingPath) { return createHostNameOrIpValidators(); case 'HostConfig.Protocol': return [(value) => constants.protocolTypeList.contains(value)]; + case 'Path': + return [trimNotEmptyValidator]; case 'RemoteConfig.ApiPort': return [notEmptyValidator, portIsValid]; case 'RemoteConfig.EncryptionToken':