Sure. The purpose of Molotov-Ribbentrop at all was to secure Hitler’s east. And laying claim to the crown jewels of the Holy Roman Empire spelled out Hitler’s intentions only too clearly.
For Stalin, it was to guarantee a War in the West, to greatly weaken the European armies and make the continent easy pickings for the Red Army.
It's actually fortunate that France fell as quickly as it did, and saved the Western campaign from being a bloodbath.