From 8e9680223d877cccbcbb52ba13507ffe097778e7 Mon Sep 17 00:00:00 2001 From: valli_0x <65861300+valli0x@users.noreply.github.com> Date: Thu, 9 Mar 2023 14:25:45 +0300 Subject: [PATCH] bug: correct sdk handling of the zero int64 value (#18729) * bug: correct handling of the zero int64 value * Update changelog/18729.txt --------- Co-authored-by: valli_0x Co-authored-by: Tom Proctor --- changelog/18729.txt | 3 +++ sdk/framework/backend.go | 2 ++ 2 files changed, 5 insertions(+) create mode 100644 changelog/18729.txt diff --git a/changelog/18729.txt b/changelog/18729.txt new file mode 100644 index 000000000..975d0274b --- /dev/null +++ b/changelog/18729.txt @@ -0,0 +1,3 @@ +```release-note:bug +sdk/backend: prevent panic when computing the zero value for a `TypeInt64` schema field. +``` \ No newline at end of file diff --git a/sdk/framework/backend.go b/sdk/framework/backend.go index 67ad2a8ed..3a6b0d804 100644 --- a/sdk/framework/backend.go +++ b/sdk/framework/backend.go @@ -752,6 +752,8 @@ func (t FieldType) Zero() interface{} { return "" case TypeInt: return 0 + case TypeInt64: + return int64(0) case TypeBool: return false case TypeMap: