Commit ddde047e authored by Patrick Storz's avatar Patrick Storz 🦄

actions/file-open: Fail early for non-existing files

Avoids crash reported in
  #1599


(cherry picked from commit c9281a16)
parent fa303fb7
Pipeline #156538577 passed with stages
in 92 minutes and 47 seconds
......@@ -26,7 +26,12 @@ void
file_open(const Glib::VariantBase& value, InkscapeApplication *app)
{
Glib::Variant<Glib::ustring> s = Glib::VariantBase::cast_dynamic<Glib::Variant<Glib::ustring> >(value);
Glib::RefPtr<Gio::File> file = Gio::File::create_for_path(s.get());
if (!file->query_exists()) {
std::cerr << "file_open: file '" << s.get() << "' does not exist." << std::endl;
return;
}
SPDocument *document = app->document_open(file);
INKSCAPE.add_document(document);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment