Breaking change in 2.1: Node.firstChild can now be null #12720
Labels
Breaking Change
Would introduce errors in existing code
Docs
The issue relates to how you learn TypeScript
Milestone
TypeScript Version: 2.1.4
This code snippet used to compile fine in 2.0 with
strictNullChecks
, but now errors in 2.1:I agree that
firstChild
can in fact benull
(even though in this case I checked withhasChildNodes
), but this is a breaking change introduced in a minor version.Workaround: check with
documentElement.firstChild &&
or add a!
in the cases where I know from the protocol that the element will have a child node.Full file: https://github.com/felixfbecker/vscode-php-debug/blob/master/src/xdebugConnection.ts
Failing build: https://travis-ci.org/felixfbecker/vscode-php-debug/builds/182024998
The text was updated successfully, but these errors were encountered: