Changing the reference to nodes will report "ERROR TypeError: Cannot read property 'data' of null"
See original GitHub issueMinimal reproduction of the bug/regression with instructions:
https://stackblitz.com/edit/angular-tree-component-demo?file=src%2Fapp%2Fapp.component.html
Click the “update tree nodes” button will see the error, But the tree nodes are updated success.
Expected behavior:
No Error report.
Versions of Angular Tree Component, Angular, Node, affected browser(s) and operating system(s):
@circlon/angular-tree-component ^10.0.0
@angular-devkit/architect 0.1100.2
@angular-devkit/build-angular 0.1100.2
@angular-devkit/core 11.0.2
@angular-devkit/schematics 11.0.2
@angular/cdk 11.0.1
@angular/flex-layout 10.0.0-beta.32
@angular/material 11.0.1
@angular/material-moment-adapter 11.0.1
@schematics/angular 11.0.2
@schematics/update 0.1100.2
ng-packagr 11.0.3
rxjs 6.5.5
typescript 4.0.5
system:
MacOS v10.14.6
Other information:
The error threw in node.isRoot
method;
I would be willing to submit a PR to fix this issue
I’m not sure. [ ] Yes (Assistance will be provided if you need help to submit a pull request) [ ] No
Issue Analytics
- State:
- Created 3 years ago
- Comments:5
Top Results From Across the Web
How to deal with TypeError: cannot read properties of null
Firstly, while programming it is a good practice to properly declare and assign the variable to a value. The “TypeError: null is not...
Read more >TypeError: Cannot read property 'data' of null - Stack Overflow
As the error explains your queryResult property is null. Add another conditional check to see if the queryResult field is not empty in...
Read more >Uncaught TypeError: Cannot read property of null - iDiallo
This error occurs when you read a property or call a method on a null object . That's because the DOM API returns...
Read more >Uncaught TypeError: Cannot read property of undefined In
This error occurs in Chrome Browser when you read a property or call a method on an undefined object . There are a...
Read more >cannot read properties of null (reading 'matches') npm - You.com
I read the log file: TypeError: Cannot read properties of null (reading 'matches') at Link.matches. And I read the specific address in node.js....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Still not sure that it’s OK, but instead of node.IsRoot you can write node.parent == null || node.parent.data.virtual Here is my workaround:
<div *ngIf="(node.parent == null || node.parent.data.virtual)" class="inline p-w-xxs">...</div>
The error is reported in:
Modify to: