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