Revert "Fix crash when g-code generation is triggered but no objects are loaded."

This reverts commit dc2b4a3753ee7d66710befddc6558e555a20c806.