diff --git a/src/uri.cpp b/src/uri.cpp
index 663bd0af56f1d1f6fa508105fb68bba9e705d88c..7517819fc0c5601f5d78ceada6423bd22ced7915 100644
--- a/src/uri.cpp
+++ b/src/uri.cpp
@@ -169,7 +169,7 @@ URIPimpl::strip(const QString& uri, URI::SchemeType& schemeType, QString& scheme
 
     schemeType = URI::SchemeType::UNRECOGNIZED;
     auto it = std::find_if(schemeNames.begin(), schemeNames.end(), [&scheme](auto& it) {
-        if (it.second == "ring:" && scheme == "jami:")
+        if (std::string(it.second) == "ring:" && scheme == "jami:")
             return true;
         return it.second == scheme;
     });