Skip to content
Snippets Groups Projects
Commit 310e3973 authored by Jake Taylor's avatar Jake Taylor
Browse files

allow nullable facts for ud.NewFromBackup in bindings

parent ddaf72be
No related branches found
No related tags found
1 merge request!510Release
......@@ -144,8 +144,8 @@ func LoadOrNewUserDiscovery(e2eID int, follower UdNetworkStatus,
// Parameters:
// - e2eID - e2e object ID in the tracker
// - follower - network follower func wrapped in UdNetworkStatus
// - emailFactJson - a JSON marshalled email fact.Fact
// - phoneFactJson - a JSON marshalled phone fact.Fact
// - emailFactJson - nullable JSON marshalled email fact.Fact
// - phoneFactJson - nullable JSON marshalled phone fact.Fact
func NewUdManagerFromBackup(e2eID int, follower UdNetworkStatus, emailFactJson,
phoneFactJson []byte) (*UserDiscovery, error) {
......@@ -156,15 +156,19 @@ func NewUdManagerFromBackup(e2eID int, follower UdNetworkStatus, emailFactJson,
}
var email, phone fact.Fact
if emailFactJson != nil {
err = json.Unmarshal(emailFactJson, &email)
if err != nil {
return nil, err
}
}
if phoneFactJson != nil {
err = json.Unmarshal(phoneFactJson, &phone)
if err != nil {
return nil, err
}
}
UdNetworkStatusFn := func() xxdk.Status {
return xxdk.Status(follower.UdNetworkStatus())
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment