Avoid crashing when getting Fieldseeker client

This commit is contained in:
Eli Ribble 2026-04-16 20:40:37 +00:00
parent ee2254281c
commit 1bc452bc09
No known key found for this signature in database

View file

@ -308,6 +308,9 @@ func updateArcgisUserData(ctx context.Context, user *models.User, oauth *models.
}
func newFieldSeeker(ctx context.Context, oa *models.ArcgisOauthToken) (*fieldseeker.FieldSeeker, error) {
if oa == nil {
return nil, fmt.Errorf("no oath token")
}
row, err := sql.OrgByOauthId(oa.ID).One(ctx, db.PGInstance.BobDB)
if err != nil {
return nil, fmt.Errorf("Failed to get org ID from oauth %d: %w", oa.ID, err)