Composer.Widget: Fix criticals when "mailto:" has empty body

This commit is contained in:
Michael Gratton 2020-09-27 19:57:52 +10:00
parent 13f5602446
commit bd85c4f1a8
2 changed files with 19 additions and 4 deletions

View file

@ -92,6 +92,7 @@ public class Composer.WidgetTest : TestCase {
add_test("load_empty_body", load_empty_body);
add_test("load_empty_body_to", load_empty_body_to);
add_test("load_mailto", load_mailto);
add_test("load_mailto_empty", load_mailto_empty);
add_test("load_context_edit", load_context_edit);
add_test("load_context_reply_sender", load_context_reply_sender);
add_test("load_context_reply_sender_with_reply_to", load_context_reply_sender_with_reply_to);
@ -164,6 +165,15 @@ public class Composer.WidgetTest : TestCase {
assert_equal(widget.to, "mailto@example.com");
}
public void load_mailto_empty() throws GLib.Error {
var widget = new Widget(this.application, this.config, this.account);
widget.load_mailto.begin("mailto:", this.async_completion);
widget.load_mailto.end(async_result());
assert_equal(widget.to, "");
}
public void load_context_edit() throws GLib.Error {
var widget = new Widget(this.application, this.config, this.account);
var email = load_email(MESSAGE_WITH_REPLY_TO);