diff --git a/repertory/repertory/src/ui/handlers.cpp b/repertory/repertory/src/ui/handlers.cpp index 1c543272..e66dc4f2 100644 --- a/repertory/repertory/src/ui/handlers.cpp +++ b/repertory/repertory/src/ui/handlers.cpp @@ -38,6 +38,9 @@ namespace { [[nodiscard]] auto decrypt(std::string_view data, std::string_view password) -> std::string { REPERTORY_USES_FUNCTION_NAME(); + if (data.empty()) { + return std::string{data}; + } auto decoded = macaron::Base64::Decode(data); repertory::data_buffer buffer(decoded.size()); diff --git a/web/repertory/lib/helpers.dart b/web/repertory/lib/helpers.dart index ebf0d8df..49a4a6e7 100644 --- a/web/repertory/lib/helpers.dart +++ b/web/repertory/lib/helpers.dart @@ -259,6 +259,10 @@ Future> convertAllToString( } String encryptValue(String value, String password) { + if (value.isEmpty) { + return value; + } + final sodium = constants.sodium; if (sodium == null) { return value;