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

This will fix a crash in the GUI when "Export G-code" is selected but there are no objects on the plater.