Shell: add missing null check. Fixes #1711.
Merge pull request #1712 from jotomo/1711

Shell: add missing null check. Fixes #1711.