-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wip: fix view container 'null' error #6276
Conversation
Fixes #6231 - set the `ViewContainerLayout` explicitly so it is not `null` when it is being used. Signed-off-by: Vincent Fugnitto <vincent.fugnitto@ericsson.com>
I meant to create a draft PR but it looked like Github had a slight hiccup. |
@@ -330,7 +330,7 @@ export class ViewContainer extends BaseWidget implements StatefulWidget, Applica | |||
} | |||
|
|||
get containerLayout(): ViewContainerLayout { | |||
return this.panel.layout as ViewContainerLayout; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand how it can be null
: init
is called before any other call and it sets panel and its layout.
I cannot reproduce it anymore. Does anyone know the exact steps? |
This fixes only the symptom not the underlying problem, which is those widgets are disposed (widget dispose nulls the layout). |
Got it finally, the exception is thrown because I can confirm, the error is gone if I open the
I second this. We need another fix. |
@kittaakos @svenefftinge thanks for helping find the root cause, I initially wanted to have the PR as a draft specifically for that reason. I don't quite understand why the container has to be disposed on |
@vince-fugnitto On new deployment a plugin can be removed then its views and view containers should be removed. You can reproduce it by stopping a server, removing a plugin contributing a view and starting a server. A client should reconnect and remove view containers. Apparently we don't remove all references to view container afterwards. |
Thank you for the clarification :) |
What it does
Fixes #6231
Set the
ViewContainerLayout
explicitly so it is notnull
when it is being used.How to test
Re-test the following functionality present in #5665
Review checklist
Reminder for reviewers
Signed-off-by: Vincent Fugnitto vincent.fugnitto@ericsson.com