Should check if the nodeId is null

This fix the following issue https://github.com/Sylius/Sylius/issues/1325