diff options
author | George Hazan <ghazan@miranda.im> | 2017-02-01 20:11:44 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2017-02-01 20:11:44 +0300 |
commit | d2d633a1667ea16c9c88eae9d679c91c545a77ee (patch) | |
tree | 54b712a6ce2ebfdf30a83e7705814b69fd498428 /libs | |
parent | a85c40a54d9036c98aed37071500df5926e74028 (diff) |
fix for null avatar hash processing
Diffstat (limited to 'libs')
-rw-r--r-- | libs/libjson/src/internalJSONNode.cpp | 3 | ||||
-rw-r--r-- | libs/libjson/src/internalJSONNode.h | 4 |
2 files changed, 5 insertions, 2 deletions
diff --git a/libs/libjson/src/internalJSONNode.cpp b/libs/libjson/src/internalJSONNode.cpp index 411c12582e..38ca24ff29 100644 --- a/libs/libjson/src/internalJSONNode.cpp +++ b/libs/libjson/src/internalJSONNode.cpp @@ -38,7 +38,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
static const json_string CONST_TRUE(JSON_TEXT("true"));
static const json_string CONST_FALSE(JSON_TEXT("false"));
-static const json_string CONST_NULL(JSON_TEXT("null"));
#ifdef JSON_UNIT_TEST
void internalJSONNode::incinternalAllocCount(void){ JSONNode::incinternalAllocCount(); }
@@ -344,7 +343,7 @@ void internalJSONNode::Nullify(bool validation) const { void internalJSONNode::Nullify(void) const {
#endif
_type = JSON_NULL;
- _string = CONST_NULL;
+ _string.clear();
SetFetched(true);
}
diff --git a/libs/libjson/src/internalJSONNode.h b/libs/libjson/src/internalJSONNode.h index c77e502543..26e279764e 100644 --- a/libs/libjson/src/internalJSONNode.h +++ b/libs/libjson/src/internalJSONNode.h @@ -285,11 +285,15 @@ inline void internalJSONNode::setname(const json_string & newname){ inline json_string internalJSONNode::as_string(void) const {
Fetch();
+ if (_type == JSON_NULL)
+ return json_string();
return _string;
}
inline CMStringW internalJSONNode::as_mstring(void) const {
Fetch();
+ if (_type == JSON_NULL)
+ return CMStringW();
return CMStringW(ptrW(mir_utf8decodeW(_string.c_str())));
}
|