diff --git a/plugins/ruby/codegen.pl b/plugins/ruby/codegen.pl index 265db47c5..3b11565e8 100755 --- a/plugins/ruby/codegen.pl +++ b/plugins/ruby/codegen.pl @@ -772,7 +772,7 @@ sub render_item_number { $initvalue ||= 'nil' if $typename; $subtype = $item->getAttribute('base-type') if (!$subtype or $subtype eq 'bitfield' or $subtype eq 'enum'); - $subtype = $g->getAttribute('base-type') if ($g); + $subtype ||= $g->getAttribute('base-type') if ($g); $subtype = 'int32_t' if (!$subtype); if ($subtype eq 'int64_t') {