Revert "Revert "Merge pull request #3445 from petraselmer/null-case""

This reverts commit ce6ad78d80b1a78c82d1ba9450fb810480d3c04c.