Scenes with a marker missing a primary tag fails to load

Fixes #42
This commit is contained in:
Stash Dev
2019-04-20 10:32:01 -07:00
parent 7742024dfb
commit d6eb2c2d8e
10 changed files with 30 additions and 35 deletions

View File

@@ -18,10 +18,7 @@ func (r *sceneMarkerResolver) Scene(ctx context.Context, obj *models.SceneMarker
func (r *sceneMarkerResolver) PrimaryTag(ctx context.Context, obj *models.SceneMarker) (*models.Tag, error) {
qb := models.NewTagQueryBuilder()
if !obj.PrimaryTagID.Valid {
panic("TODO no primary tag id")
}
tag, err := qb.Find(int(obj.PrimaryTagID.Int64), nil) // TODO make primary tag id not null in DB
tag, err := qb.Find(obj.PrimaryTagID, nil)
return tag, err
}