[gnumeric] ssconvert: fix critical.



commit 7b8cbc7a87bdfbd6a0e4807f38907125b308b6ee
Author: Morten Welinder <terra gnome org>
Date:   Sun Oct 4 20:54:32 2020 -0400

    ssconvert: fix critical.
    
    We don't get a modtime when fd://1 is connected to a pipe.

 ChangeLog           |  6 ++++++
 NEWS                |  1 +
 src/workbook-view.c | 10 ++++++----
 3 files changed, 13 insertions(+), 4 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 999a2844d..3d181b452 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2020-10-04  Morten Welinder  <terra gnome org>
+
+       * src/workbook-view.c (workbook_view_save_as): If we don't get a
+       modtime from the url, don't try to do anything with in.  Notably
+       happens with fd://1
+
 2020-08-12  Morten Welinder <terra gnome org>
 
        * configure.ac: Post-release bump.
diff --git a/NEWS b/NEWS
index b8d819362..d40ba6f74 100644
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,7 @@ Morten:
        * Rework conditional styling's upper level.
        * Fix autofill array critical.  [#511]
        * Handle missing values in xlsx.  [#517]
+       * Fix critical when using fd://1.
 
 --------------------------------------------------------------------------
 Gnumeric 1.12.48
diff --git a/src/workbook-view.c b/src/workbook-view.c
index fcbe08d93..a998d6d95 100644
--- a/src/workbook-view.c
+++ b/src/workbook-view.c
@@ -1220,10 +1220,12 @@ workbook_view_save_as (WorkbookView *wbv, GOFileSaver *fs, char const *uri,
                                go_doc_set_pristine (GO_DOC (wb), FALSE);
 
                                modtime = get_uri_modtime (NULL, uri);
-                               go_doc_set_modtime (GO_DOC (wb), modtime);
-                               if (gnm_debug_flag ("modtime"))
-                                       g_printerr ("Modtime set\n");
-                               g_date_time_unref (modtime);
+                               if (modtime) {
+                                       go_doc_set_modtime (GO_DOC (wb), modtime);
+                                       if (gnm_debug_flag ("modtime"))
+                                               g_printerr ("Modtime set\n");
+                                       g_date_time_unref (modtime);
+                               }
                        }
                } else
                        workbook_set_last_export_uri (wb, uri);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]