Skip to content

Conversation

@Iuliean
Copy link
Contributor

@Iuliean Iuliean commented Jul 18, 2022

This no longer causes a segfault if the key that is being searched for does not exist

@crow-clang-format
Copy link

--- include/crow/multipart.h	(before formatting)
+++ include/crow/multipart.h	(after formatting)
@@ -86,10 +86,10 @@
             part get_part_by_name(const std::string& name)
             {
                 mp_map::iterator result = part_map.find(name);
-                if(result != part_map.end())
+                if (result != part_map.end())
                     return result->second;
                 else
-                    return {}; 
+                    return {};
             }
 
             /// Represent all parts as a string (**does not include message headers**)
@The-EDev
Copy link
Member

Thank you for implementing this, sorry I didn't give you instructions in time. Could you please make a new commit fixing the formatting errors pointed out by the bot? Thanks again!

@Iuliean
Copy link
Contributor Author

Iuliean commented Jul 18, 2022

No problem

I made the commit. is it ok ?

@The-EDev
Copy link
Member

Everything seems to be alright, I'll merge it as soon as the tests are done running.

@Iuliean
Copy link
Contributor Author

Iuliean commented Jul 18, 2022

Nice

@crow-clang-format
Copy link

--- include/crow/multipart.h	(before formatting)
+++ include/crow/multipart.h	(after formatting)
@@ -86,7 +86,7 @@
             part get_part_by_name(const std::string& name)
             {
                 mp_map::iterator result = part_map.find(name);
-                if(result != part_map.end())
+                if (result != part_map.end())
                     return result->second;
                 else
                     return {};
@The-EDev The-EDev merged commit 777b2db into CrowCpp:master Jul 18, 2022
@Iuliean Iuliean deleted the get_part_by_name_fix branch July 29, 2022 11:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants