Add null check in blockBlocksFlow. Fixes #1327