Cancel when saving attachments causes soft assertion

File.new_for_path() was being passed null.
This commit is contained in:
Jim Nelson 2013-09-27 18:28:19 -07:00
parent 3efdc5b6eb
commit 34c6ca6ff4

View file

@ -1532,13 +1532,15 @@ public class GearyController : Geary.BaseObject {
dialog.set_local_only(false);
bool accepted = (dialog.run() == Gtk.ResponseType.ACCEPT);
File destination = File.new_for_path(dialog.get_filename());
string? filename = dialog.get_filename();
dialog.destroy();
if (!accepted)
if (!accepted || Geary.String.is_empty(filename))
return;
File destination = File.new_for_path(filename);
// Proceeding, save this as last destination directory
last_save_directory = (attachments.size == 1) ? destination.get_parent() : destination;