diff options
author | Gustavo Noronha Silva <gns@gnome.org> | 2009-09-05 01:12:56 +0800 |
---|---|---|
committer | Gustavo Noronha Silva <gns@gnome.org> | 2009-09-05 01:12:56 +0800 |
commit | f26d41a2e03e802f16c0f2693dad67f22b8b1edb (patch) | |
tree | b66302b502b8280f1c94b3a478a63c1d817dee1f | |
parent | d5db22b6842017772f10aa28d18458f36b025677 (diff) | |
download | gsoc2013-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.c | 5 |
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, |