The Error “Error: “Cannot read properties of null””, is an error that is invoked when you are working on visual studio code and trying to use the list of test in your VS Code application.
Given below is the snippet of the error you might get:
Error: "Cannot read properties of null (reading 'command')"
The error, “Error: “Cannot read properties of null (reading ‘command’)” is seen because of compatibility issue in rendering the tree objects in VS Code latest version 1.70.2 and Test Explorer extension version.

To fix the error, Error: “Cannot read properties of null (reading ‘command’)”, change the “Tree” mode configuration to “flat tree” mode for the tests to display. Go to Settings > Extensions > .NET Core Test Explorer > Set Tree mode to flat. Or in settings.json, “dotnet-test-explorer.treeMode”: ” flat, and error would be fixed.
Steps to fix the error Error: “Cannot read properties of null (reading ‘command’)”:
Step 1: Set ‘Tree”‘ Mode to “‘flat’ Mode
First you will have to set “Tree mode” is set to “flat tree” mode for the tests to display; otherwise, none will be found.

This is because of how tree objects are started in the more recent version of VSCode.
Step 2: Run Code Again
Now once appropriates changes have been done into your code, run the project again, Error: “Cannot read properties of null” would be fixed.
This should help you fix the error, Error: “Cannot read properties of null (reading ‘command’)”.
Conclusion
To fix the error, “Error: “Cannot read properties of null”” you will have to set “Tree mode” is set to “flat” for the tests to display; otherwise, none will be found.