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

Commit

Permalink
fix: null pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
tomwwinter committed Feb 8, 2024
1 parent aead16d commit 92fbeb1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export class ReportCalculationRepository {
params: {
include_docs: true,
start_key: '"ReportCalculation"',
end_key: '"ReportCalculation' + 'ufff0"', // ufff0 -> high value unicode character
end_key: '"ReportCalculation' + '\ufff0"', // ufff0 -> high value unicode character
},
headers: {
Authorization: this.authHeaderValue,
Expand Down Expand Up @@ -172,7 +172,7 @@ export class ReportCalculationRepository {
params: {
include_docs: true,
start_key: '"' + calculationId + '"',
end_key: '"ReportCalculation' + 'ufff0"', // ufff0 -> high value unicode character
end_key: '"ReportCalculation' + '\ufff0"', // ufff0 -> high value unicode character
},
headers: {
Authorization: this.authHeaderValue,
Expand Down
4 changes: 4 additions & 0 deletions src/report/storage/report-storage.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ export class DefaultReportStorage implements ReportStorage {
fetchAllReports(authToken: string): Observable<Report[]> {
return this.reportRepository.fetchReports(authToken).pipe(
map((response) => {
if (!response || !response.rows) {
return [];
}

return response.rows.map((reportEntity) =>
new Report(reportEntity.id, reportEntity.doc.title).setSchema(
reportEntity.doc.aggregationDefinitions,
Expand Down

0 comments on commit 92fbeb1

Please sign in to comment.