# TS18049: '…' is possibly 'null' or 'undefined'.

> A value that may be `null` or `undefined` is used without a check. Handle both cases first.

## What it means

With `strictNullChecks`, a value whose type includes both `null` and `undefined` can't be
dereferenced directly. A loose `!= null` check covers both.

## Example

```ts
export function upper(s: string | null | undefined) {
  return s.toUpperCase();
}
```

## How to fix

- Check both at once: `if (s == null) return "";`.
- Use optional chaining and a default: `s?.toUpperCase() ?? ""`.

Source: https://ts-r.dev/errors/TS18049/
