FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Don't crash in the headless CLI when a linked file is missing by dodox1 · Pull Request #1768 · solvespace/solvespace · GitHub

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .cpp  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
8 changes: 8 additions & 0 deletions src/file.cpp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -874,6 +874,14 @@ static Platform::MessageDialog::Response LocateImportedFile(const Platform::Path
Platform::MessageDialogRef dialog = CreateMessageDialog(SS.GW.window);

using Platform::MessageDialog;
if(!dialog) {
// When running the headless CLI version no dialog is possible, so
// decline to locate the file.
dbp("The linked file '%s' is not present; continuing without it.",
filename.raw.c_str());
return MessageDialog::Response::NO;
}

dialog->SetType(MessageDialog::Type::QUESTION);
dialog->SetTitle(C_("title", "Missing File"));
dialog->SetMessage(ssprintf(C_("dialog", "The linked file “%s” is not present."),
Expand Down

Back | FazBrowse Home | New Git URL