From fde9539191d443880ee73158176eb856aa08d9b3 Mon Sep 17 00:00:00 2001 From: Eli Ribble Date: Thu, 16 Apr 2026 23:54:18 +0000 Subject: [PATCH] Don't attempt to find the parcel if our address ID is nil That's because the address doesn't have location data, so we can't find a parcel. --- platform/csv/csv.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/platform/csv/csv.go b/platform/csv/csv.go index a5bcf2ef..4f970564 100644 --- a/platform/csv/csv.go +++ b/platform/csv/csv.go @@ -62,6 +62,7 @@ func JobCommit(ctx context.Context, txn bob.Executor, file_id int32) error { } for _, row := range rows { var a *types.Address + var parcel *models.Parcel if row.AddressID.IsValue() { var ok bool a, ok = addresses[row.AddressID.MustGet()] @@ -69,6 +70,10 @@ func JobCommit(ctx context.Context, txn bob.Executor, file_id int32) error { log.Error().Int32("id", row.AddressID.MustGet()).Msg("address is missing") continue } + parcel, err = geocode.GetParcel(ctx, txn, *a) + if err != nil { + return fmt.Errorf("get parcel: %w", err) + } } else { a = &types.Address{ Country: "usa", @@ -80,10 +85,6 @@ func JobCommit(ctx context.Context, txn bob.Executor, file_id int32) error { Unit: "", } } - parcel, err := geocode.GetParcel(ctx, txn, *a) - if err != nil { - return fmt.Errorf("get parcel: %w", err) - } var site *models.Site site, err = models.Sites.Query( models.SelectWhere.Sites.AddressID.EQ(*a.ID),