Added nil check to deserializeinfo

graph-rework-2
noah metz 2023-07-11 00:23:07 -06:00
parent c30b9d082a
commit 7a95af6db2
1 changed files with 10 additions and 7 deletions

@ -366,14 +366,17 @@ func RestoreSimpleThread(ctx *Context, thread Thread, j SimpleThreadJSON, nodes
return fmt.Errorf("%+v is not a Thread as expected", child_node) return fmt.Errorf("%+v is not a Thread as expected", child_node)
} }
info_ser, err := json.Marshal(info_raw) var parsed_info ThreadInfo
if err != nil { if info_raw != nil {
return err info_ser, err := json.Marshal(info_raw)
} if err != nil {
return err
}
parsed_info, err := thread.DeserializeInfo(ctx, info_ser) parsed_info, err = thread.DeserializeInfo(ctx, info_ser)
if err != nil { if err != nil {
return err return err
}
} }
thread.AddChild(child_t, parsed_info) thread.AddChild(child_t, parsed_info)