From a9a7af2195ec1ce89095d5ec90ff380c8ab05600 Mon Sep 17 00:00:00 2001 From: Alessio Date: Sun, 14 Jul 2024 13:24:44 -0700 Subject: [PATCH] Band-aid fix for spaces with null fields in them --- pkg/persistence/compound_queries.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkg/persistence/compound_queries.go b/pkg/persistence/compound_queries.go index 8151e00..342c24d 100644 --- a/pkg/persistence/compound_queries.go +++ b/pkg/persistence/compound_queries.go @@ -59,8 +59,10 @@ func (p Profile) fill_content(trove *TweetTrove, current_user_id UserID) { if len(space_ids) > 0 { var spaces []Space err := p.DB.Select(&spaces, ` - select id, ifnull(created_by_id, 0) created_by_id, short_url, state, title, created_at, started_at, ended_at, updated_at, - is_available_for_replay, replay_watch_count, live_listeners_count, is_details_fetched + select id, ifnull(created_by_id, 0) created_by_id, short_url, state, title, ifnull(created_at, 0) created_at, + ifnull(started_at, 0) started_at, ifnull(ended_at, 0) ended_at, ifnull(updated_at, 0) updated_at, + ifnull(is_available_for_replay, 0) is_available_for_replay, ifnull(replay_watch_count, 0) replay_watch_count, + ifnull(live_listeners_count, 0) replay_watch_count, is_details_fetched from spaces where id in (`+strings.Repeat("?,", len(space_ids)-1)+`?)`, space_ids...,