Skip to content
This repository has been archived by the owner on Apr 8, 2024. It is now read-only.

Commit

Permalink
fix(worker): panics when gdata item is nil
Browse files Browse the repository at this point in the history
  • Loading branch information
rot1024 committed Feb 28, 2024
1 parent 55ba2b0 commit 43d3757
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions worker/preparegspatialjp/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,15 +96,18 @@ func Command(conf *Config) (err error) {
gdataItem := GspatialjpDataItemFrom(gdataItemRaw)
log.Infofc(ctx, "geospatialjp data item: %s", ppp.Sprint(gdataItem))

if !gdataItem.ShouldMergeCityGML() {
conf.SkipCityGML = true
}
if !gdataItem.ShouldMergePlateau() {
conf.SkipPlateau = true
}
if !gdataItem.ShouldMergeMaxLOD() {
conf.SkipMaxLOD = true
if gdataItem != nil {
if !gdataItem.ShouldMergeCityGML() {
conf.SkipCityGML = true
}
if !gdataItem.ShouldMergePlateau() {
conf.SkipPlateau = true
}
if !gdataItem.ShouldMergeMaxLOD() {
conf.SkipMaxLOD = true
}
}

if conf.SkipCityGML && conf.SkipPlateau && conf.SkipMaxLOD && conf.SkipRelated {
return fmt.Errorf("no command to run")
}
Expand Down

0 comments on commit 43d3757

Please sign in to comment.