From 1905951cab5d636d998b8c4808e4749b966c6830 Mon Sep 17 00:00:00 2001 From: contrapunctus Date: Wed, 27 Apr 2022 21:22:53 +0530 Subject: [PATCH] Prevent error when there is no new OSM data to insert --- init.org | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/init.org b/init.org index cff201a..0f5e766 100644 --- a/init.org +++ b/init.org @@ -1963,11 +1963,9 @@ When I clock out of the "OSM" task, this code stores changeset details in it. if (equal id last-id) return (reverse changesets) else collect - (list - :osm-url - (my-make-osm-url id) - :osm-comment - (my-get-changeset-comment changeset)) into changesets) + (list :osm-url (my-make-osm-url id) + :osm-comment (my-get-changeset-comment changeset)) + into changesets) ;; no changeset information in file - just use ;; the latest changeset from the response (let* ((changeset (first response-changesets)) @@ -1979,7 +1977,9 @@ When I clock out of the "OSM" task, this code stores changeset details in it. (chronometrist-latest-record (chronometrist-active-backend)) `(:changesets ,new-changesets)))) ;; (message "Last changeset ID - %s" last-id) - (chronometrist-replace-last (chronometrist-active-backend) new-plist))) + ;; don't update if the latest changeset ID was already recorded + (when new-changesets + (chronometrist-replace-last (chronometrist-active-backend) new-plist)))) #+END_SRC ***** my-save-osm-changeset-details