Skip to content

Dialog: guard even harder against null parent

Christoph Wolk requested to merge cwo/kirigami:dialog_null_parent into master

Dialog guards against null parents with a ternary statement. This doesn't quite work while the parent is being unloaded though, the access still goes through and TypeErrors are generated.

It works if we guard even more explicitly by checking the parent with &&.


Test plan:

  1. kcmshell6 kcm_kscreen, then close the window
  2. (without) several TypeErrors (with) no TypeErrors

It really feels like this shouldn't be necessary, but apparently it is? Not even optional chaining is good enough, parent?.height still gives a "TypeError: Cannot read property 'height' of null"...

Merge request reports

Loading