sup

A curses threads-with-tags style email client

ncursesw-ruby.git

git clone https://supmua.dev/git/ncursesw-ruby/
commit 8c9003c9fcb0161c43df034439dba610a1495ac0
parent b240bb5ad794a86776d1803d66b49a03328ade67
Author: Dan Callaghan <djc@djc.id.au>
Date:   Sat,  7 Nov 2026 14:45:27 +1100

handle NULL for ITEM name and description

Diffstat:
M menu_wrap.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/menu_wrap.c b/menu_wrap.c
@@ -781,7 +781,9 @@ static VALUE rbncurs_m_pos_menu_cursor(VALUE dummy, VALUE rb_menu)
 static VALUE rbncurs_c_item_name(VALUE rb_item)
 {
   ITEM *item = get_item(rb_item);
-  return rb_str_new2(item_name(item));
+  char *str = item_name(item);
+  if (str == NULL) return Qnil;
+  return rb_str_new2(str);
 }
 static VALUE rbncurs_m_item_name(VALUE dummy, VALUE rb_item)
 { return rbncurs_c_item_name(rb_item); }
@@ -789,7 +791,9 @@ static VALUE rbncurs_m_item_name(VALUE dummy, VALUE rb_item)
 static VALUE rbncurs_c_item_description(VALUE rb_item)
 {
   ITEM *item = get_item(rb_item);
-  return rb_str_new2(item_description(item));
+  char *str = item_description(item);
+  if (str == NULL) return Qnil;
+  return rb_str_new2(str);
 }
 static VALUE rbncurs_m_item_description(VALUE dummy, VALUE rb_item)
 { return rbncurs_c_item_description(rb_item); }