fix: transmission-remote warning when adding magnet link (#5088)

This commit is contained in:
Charles Kerr 2023-02-27 15:58:38 -06:00 committed by GitHub
parent f53e58c8bd
commit 5ada8c46d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -544,9 +544,9 @@ static int getOptMode(int val)
}
}
static std::string getEncodedMetainfo(std::string_view filename)
static std::string getEncodedMetainfo(char const* filename)
{
if (auto contents = std::vector<char>{}; tr_loadFile(filename, contents))
if (auto contents = std::vector<char>{}; tr_sys_path_exists(filename) && tr_loadFile(filename, contents))
{
return tr_base64_encode({ std::data(contents), std::size(contents) });
}