Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/slic3r/GUI/CreatePresetsDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1038,7 +1038,13 @@ wxBoxSizer *CreateFilamentPresetDialog::create_button_item()
}
boost::algorithm::trim(vendor_name);
boost::algorithm::trim(serial_name);
if (vendor_name.empty() || serial_name.empty()) {
if (serial_name.empty()) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The check is duplicated with L1042

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed, thanks. The second condition now only checks vendor_name.empty(), since the empty serial case already returns immediately above.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correction: my previous follow-up modified the earlier guard instead of the duplicated post-trim check. This is now fixed correctly: the first validation again checks both vendor and serial, while the later condition only checks vendor_name.empty() because the empty serial case already returns immediately above.

MessageDialog dlg(this, _L("The filament serial contains only invalid characters or spaces. Please correct it."),
wxString(SLIC3R_APP_FULL_NAME) + " - " + _L("Info"), wxYES | wxYES_DEFAULT | wxCENTRE);
dlg.ShowModal();
return;
}
if (vendor_name.empty()) {
MessageDialog dlg(this, _L("All inputs in the custom vendor or serial are spaces. Please re-enter."),
wxString(SLIC3R_APP_FULL_NAME) + " - " + _L("Info"), wxYES | wxYES_DEFAULT | wxCENTRE);
dlg.ShowModal();
Expand Down
Loading