Dialog: guard even harder against null parent
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:
-
kcmshell6 kcm_kscreen
, then close the window - (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"...