Set TS flag `strictNullChecks` to true and have safer null handling to prevent potential future errors