Add missing curly brackets in STDREGEX's CreatePattern(). 1506/head
authorylavic <ylavic.dev@gmail.com>
Mon, 29 Apr 2019 13:06:52 +0000 (15:06 +0200)
committerylavic <ylavic.dev@gmail.com>
Mon, 29 Apr 2019 13:06:52 +0000 (15:06 +0200)
include/rapidjson/schema.h

index 5b622f7..26ae947 100644 (file)
@@ -1149,7 +1149,7 @@ private:
 #elif RAPIDJSON_SCHEMA_USE_STDREGEX
     template <typename ValueType>
     RegexType* CreatePattern(const ValueType& value) {
-        if (value.IsString())
+        if (value.IsString()) {
             RegexType *r = static_cast<RegexType*>(allocator_->Malloc(sizeof(RegexType)));
             try {
                 return new (r) RegexType(value.GetString(), std::size_t(value.GetStringLength()), std::regex_constants::ECMAScript);
@@ -1157,6 +1157,7 @@ private:
             catch (const std::regex_error&) {
                 AllocatorType::Free(r);
             }
+        }
         return 0;
     }