aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGustavo Noronha Silva <gns@gnome.org>2009-09-05 01:12:56 +0800
committerGustavo Noronha Silva <gns@gnome.org>2009-09-05 01:12:56 +0800
commitf26d41a2e03e802f16c0f2693dad67f22b8b1edb (patch)
treeb66302b502b8280f1c94b3a478a63c1d817dee1f
parentd5db22b6842017772f10aa28d18458f36b025677 (diff)
downloadgsoc2013-epiphany-f26d41a2e03e802f16c0f2693dad67f22b8b1edb.tar.gz
gsoc2013-epiphany-f26d41a2e03e802f16c0f2693dad67f22b8b1edb.tar.zst
gsoc2013-epiphany-f26d41a2e03e802f16c0f2693dad67f22b8b1edb.zip
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.
-rw-r--r--src/window-commands.c5
1 files changed, 4 insertions, 1 deletions
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,