Skip to content

Commit

Permalink
Fix error handling of time
Browse files Browse the repository at this point in the history
  • Loading branch information
andydotxyz committed Sep 13, 2024
1 parent 45a4e63 commit db68110
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/gui/json.go
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,11 @@ func decodeFields(e reflect.Value, in map[string]interface{}) error {
s := reflect.ValueOf(v).String()

t, err := time.Parse(time.RFC3339, s)
f.Set(reflect.ValueOf(t))
if err != nil {
fyne.LogError("Failed parse time "+s, err)
} else {
f.Set(reflect.ValueOf(t))
}
default:
if strings.Index(typeName, "int") == 0 {
f.SetInt(int64(reflect.ValueOf(v).Float()))
Expand Down

0 comments on commit db68110

Please sign in to comment.