From 1a5ff442cbc0877f5726966ce2984a965d894dc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Mon, 30 Oct 2023 08:29:55 +0100 Subject: [PATCH] ruby: fix use of NULL variable when displaying exception --- ChangeLog.adoc | 1 + src/plugins/ruby/weechat-ruby.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ChangeLog.adoc b/ChangeLog.adoc index acae24bad..f18f72be6 100644 --- a/ChangeLog.adoc +++ b/ChangeLog.adoc @@ -26,6 +26,7 @@ Bug fixes:: * core: fix crash when a custom bar item name is already used by a default bar item (issue #2034) * core: fix random timeouts when a lot of concurrent processes are launched with hook_process (issue #2033) * irc: revert compute of nick colors to case sensitive way, deprecate again infos "irc_nick_color" and "irc_nick_color_name" (issue #194, issue #2032) + * ruby: fix use of NULL variable when displaying exception Build:: diff --git a/src/plugins/ruby/weechat-ruby.c b/src/plugins/ruby/weechat-ruby.c index 391d0d236..8e43b94fb 100644 --- a/src/plugins/ruby/weechat-ruby.c +++ b/src/plugins/ruby/weechat-ruby.c @@ -287,7 +287,7 @@ weechat_ruby_print_exception (VALUE err) err_class = StringValuePtr (class_name); } - if (strcmp (err_class, "SyntaxError") == 0) + if (err_class && (strcmp (err_class, "SyntaxError") == 0)) { tmp3 = rb_inspect (err); weechat_printf (NULL,