diff --git a/CHANGELOG.md b/CHANGELOG.md index a7586f7..7993230 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +### [2.1.6](https://github.com/JamesNZL/flow-toggl-plugin/compare/v2.1.5...v2.1.6) (2023-05-16) + + +### Bug Fixes + +* **ux:** :bug: fix `start` crash when no previous time entries ([#7](https://github.com/JamesNZL/flow-toggl-plugin/issues/7)) ([196b68e](https://github.com/JamesNZL/flow-toggl-plugin/commit/196b68ef35506c174517f36cfa04080954c1e579)) + ### [2.1.5](https://github.com/JamesNZL/flow-toggl-plugin/compare/v2.1.4...v2.1.5) (2023-05-16) diff --git a/src/TogglTrack.cs b/src/TogglTrack.cs index 6d786e2..52982fe 100644 --- a/src/TogglTrack.cs +++ b/src/TogglTrack.cs @@ -580,7 +580,7 @@ internal async ValueTask> RequestStartEntry(CancellationToken token } // Use cached time entries here to ensure responsiveness - var likelyPastTimeEntry = (await this._GetTimeEntries())?.First(); + var likelyPastTimeEntry = (await this._GetTimeEntries())?.FirstOrDefault(); if ((likelyPastTimeEntry is null) || (likelyPastTimeEntry.stop is null)) { return results; @@ -605,7 +605,7 @@ internal async ValueTask> RequestStartEntry(CancellationToken token // Force a new fetch to ensure correctness // User input has ended at this point so no responsiveness concerns - var lastTimeEntry = (await this._GetTimeEntries(true))?.First(); + var lastTimeEntry = (await this._GetTimeEntries(true))?.FirstOrDefault(); if (lastTimeEntry is null) { throw new Exception("There is no previous time entry."); diff --git a/src/plugin.json b/src/plugin.json index 875cc7c..925af12 100644 --- a/src/plugin.json +++ b/src/plugin.json @@ -4,7 +4,7 @@ "Name": "Toggl Track", "Description": "A time tracking plugin for Flow Launcher using Toggl Track", "Author": "JamesNZL", - "Version": "2.1.5", + "Version": "2.1.6", "Language": "csharp", "Website": "https://github.com/JamesNZL/flow-toggl-plugin", "IcoPath": "app.png",