add null checks for delete and update

This commit is contained in:
Hepatica
2024-08-18 23:24:57 +02:00
parent 81b23fc8a5
commit 62e0d495ba

View File

@@ -102,6 +102,13 @@ int main()
std::string name = req.get_file_value("Name").content;
if (name.empty() || name == " ")
{
res.set_content("Select another app name", "text/plain");
return;
}
std::string authorization_token = req.get_header_value("Authorization");
string is_user_banned = mongo_service.is_user_banned(authorization_token);
@@ -139,6 +146,13 @@ int main()
std::string name = req.get_file_value("Name").content;
if (name.empty() || name == " ")
{
res.set_content("Select another app name", "text/plain");
return;
}
std::string authorization_token = req.get_header_value("Authorization");
string is_user_banned = mongo_service.is_user_banned(authorization_token);