summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/plugins/javascript/weechat-js-api.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/plugins/javascript/weechat-js-api.cpp b/src/plugins/javascript/weechat-js-api.cpp
index ad6a4e9fa..6ffe55673 100644
--- a/src/plugins/javascript/weechat-js-api.cpp
+++ b/src/plugins/javascript/weechat-js-api.cpp
@@ -101,13 +101,17 @@ using namespace v8;
#define API_RETURN_EMPTY \
return String::New("");
#define API_RETURN_STRING(__string) \
- return String::New(__string)
+ if (__string) \
+ return String::New(__string); \
+ return String::New("")
#define API_RETURN_STRING_FREE(__string) \
+ if (__string) \
{ \
Handle<Value> return_value = String::New(__string); \
free ((void *)__string); \
return return_value; \
- }
+ } \
+ return String::New("")
#define API_RETURN_INT(__int) \
return Integer::New(__int)
#define API_RETURN_LONG(__int) \
@@ -3188,6 +3192,9 @@ API_FUNC(buffer_get_string)
result = weechat_buffer_get_string (
(struct t_gui_buffer *)API_STR2PTR(*buffer),
*property);
+ weechat_log_printf ("buffer: %s", *buffer);
+ weechat_log_printf ("property: %s", *property);
+ weechat_log_printf ("result: %lx", result);
API_RETURN_STRING(result);
}