Fix broken upgradestep 1707 if no workspaces exists.

@maethu Fix broken upgradestep 1707 if no workspaces exists.