[gjs: 5/6] jsapi-util-string: Fix return of gjs_get_string_id()
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gjs: 5/6] jsapi-util-string: Fix return of gjs_get_string_id()
- Date: Sat, 27 Jan 2018 22:21:14 +0000 (UTC)
commit 478b250c4ef0e38d1251bf61ded6cb39cb975389
Author: Philip Chimento <philip chimento gmail com>
Date: Sun Jan 21 16:11:26 2018 -0800
jsapi-util-string: Fix return of gjs_get_string_id()
Previously, the code checked if name_p was a valid location, which it
always is. It was supposed to check if name_p pointed to a non-null
string.
gjs/jsapi-util-string.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/gjs/jsapi-util-string.cpp b/gjs/jsapi-util-string.cpp
index db43b4d..9ce4358 100644
--- a/gjs/jsapi-util-string.cpp
+++ b/gjs/jsapi-util-string.cpp
@@ -325,7 +325,7 @@ gjs_get_string_id (JSContext *context,
if (id_val.isString()) {
JS::RootedString str(context, id_val.toString());
name_p->reset(JS_EncodeStringToUTF8(context, str));
- return !!name_p;
+ return !!*name_p;
} else {
return false;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]