Project

General

Profile

Actions

致命的 #1168

closed

multiselectでブロックなしoptionのみだとクラッシュする

Added by あひる 家鴨 about 7 years ago. Updated about 7 years ago.

Status:
終了
Priority:
通常
Target version:
Start date:
2018-02-10
Due date:
% Done:

0%

プラグイン名:

Description

以下のコードを実行すると落ちる。

Plugin.create(:sample_settings) do
  multiselect('複数セレクト', :sample_settings_multiselect) do
    option(:opt1, 'オプション1')
    option(:opt2, 'オプション2')
    option(:opt3, 'オプション3')
  end
end

optionを以下のようなブロック付きに変更した場合は落ちない

option(:opt1, 'オプション1') do
  select('なんか', :opt1_select, {})
end

source:/core/mui/gtk_form_dsl_multi_select.rb#L21@parent_klass がnilになっているのが原因らしい。
なぜそうなってるかまでは追えていない。


Files

sample_settings.rb (346 Bytes) sample_settings.rb あひる 家鴨, 2018-02-10 19:27

バックトレース

/Users/ahiru/mikutter/repo/app/core/mui/gtk_form_dsl_multi_select.rb:21:in `build': undefined method `create_inner_setting' for nil:NilClass (NoMethodError)
from /Users/ahiru/mikutter/repo/app/core/mui/gtk_form_dsl.rb:280:in `multiselect'
from /Users/ahiru/.mikutter/plugin/sample_settings/sample_settings.rb:42:in `block (3 levels) in <top (required)>'
from /Users/ahiru/mikutter/repo/app/core/mui/gtk_form_dsl.rb:188:in `instance_eval'
from /Users/ahiru/mikutter/repo/app/core/mui/gtk_form_dsl.rb:188:in `settings'
from /Users/ahiru/.mikutter/plugin/sample_settings/sample_settings.rb:19:in `block (2 levels) in <top (required)>'
from /Users/ahiru/mikutter/repo/app/core/plugin/settings/menu.rb:58:in `instance_eval'
from /Users/ahiru/mikutter/repo/app/core/plugin/settings/menu.rb:58:in `widget'
from /Users/ahiru/mikutter/repo/app/core/plugin/settings/settings.rb:37:in `block in setting_window'
from /Users/ahiru/mikutter/repo/app/core/mui/gtk_extension.rb:35:in `block in safety_signal_connect'
from /Users/ahiru/mikutter/repo/app/core/plugin/gtk/mainloop.rb:10:in `main'
from /Users/ahiru/mikutter/repo/app/core/plugin/gtk/mainloop.rb:10:in `mainloop'
from mikutter.rb:68:in `boot!'
from mikutter.rb:104:in `<main>'


再現手順

1. 添付したプラグインを入れる
2. mikutterを起動し、設定を開く
3. '複数セレクト' タブを開くと落ちる

Actions #1

Updated by あひる 家鴨 about 7 years ago

topic/1168-fix-multiselect-option ブランチにて修正しました。
確認をお願いします。

以下のコードで設定を開いたときに落ちず、かつ設定項目が見えていれば問題ないと思います。

Plugin.create(:sample_settings) do
  multiselect('複数セレクト', :sample_settings_multiselect) do
    option(:opt1, 'オプション1')
    option(:opt2, 'オプション2')
    option(:opt3, 'オプション3')
  end
end

Actions #2

Updated by あひる 家鴨 about 7 years ago

  • Status changed from 新規 to レビュー待ち
  • Assignee set to toshi_a 初音
Actions #3

Updated by toshi_a 初音 about 7 years ago

  • Status changed from レビュー待ち to 終了

確認できたのでmasterにmergeしました

Actions

Also available in: Atom PDF