diff --git a/server/services/store/sqlstore/blocks.go b/server/services/store/sqlstore/blocks.go index 047d94b96..c1c8e6a8b 100644 --- a/server/services/store/sqlstore/blocks.go +++ b/server/services/store/sqlstore/blocks.go @@ -218,7 +218,7 @@ func (s *SQLStore) GetAllBlocks() ([]model.Block, error) { func blocksFromRows(rows *sql.Rows) ([]model.Block, error) { defer rows.Close() - var results []model.Block + var results = []model.Block{} for rows.Next() { var block model.Block diff --git a/webapp/src/octoClient.ts b/webapp/src/octoClient.ts index e35b66ba8..aa49e7310 100644 --- a/webapp/src/octoClient.ts +++ b/webapp/src/octoClient.ts @@ -28,7 +28,8 @@ class OctoClient { private async getJson(response: Response, defaultValue: any = {}): Promise { // The server may return null or malformed json try { - return await response.json() + const value = await response.json() + return value || defaultValue } catch { return defaultValue }