From f26d41a2e03e802f16c0f2693dad67f22b8b1edb Mon Sep 17 00:00:00 2001 From: Gustavo Noronha Silva Date: Fri, 4 Sep 2009 14:12:56 -0300 Subject: When the DataSource is empty, display empty file instead of crashing This is so that we don't crash when trying to view source for about:blank, and friends. --- src/window-commands.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/window-commands.c b/src/window-commands.c index e2b8233de..cefaa4ca5 100644 --- a/src/window-commands.c +++ b/src/window-commands.c @@ -690,7 +690,10 @@ save_temp_source_replace_cb (GFile *file, GAsyncResult *result, EphyEmbed *embed /* We create a new GString here because we need to make sure * we keep writing in case of partial writes */ - data = g_string_new_len (const_data->str, const_data->len); + if (const_data) + data = g_string_new_len (const_data->str, const_data->len); + else + data = g_string_new_len ("", 0); g_output_stream_write_async (G_OUTPUT_STREAM (ostream), data->str, data->len, -- cgit v1.2.3