mirror of
https://github.com/pocketbase/pocketbase.git
synced 2026-11-05 19:47:25 +01:00
[#1365] fixed Record.MergeExpand panic
This commit is contained in:
1 parent
f91f009fce
commit
4abc8ae021
2 files changed
+46
-1
No files matched your search
@@ -139,6 +139,10 @@ func (m *Record) SetExpand(expand map[string]any) {
|
||||
// then both old and new records will be merged into a new slice (aka. a :merge: [b,c] => [a,b,c]).
|
||||
// Otherwise the "old" expanded record will be replace with the "new" one (aka. a :merge: aNew => aNew).
|
||||
func (m *Record) MergeExpand(expand map[string]any) {
|
||||
if m.expand == nil && len(expand) > 0 {
|
||||
m.expand = make(map[string]any)
|
||||
}
|
||||
|
||||
for key, new := range expand {
|
||||
old, ok := m.expand[key]
|
||||
if !ok {
|
||||
|
||||
Reference in new issue
Block a user