Skip to content

Commit

Permalink
Merge pull request #4118 from Niels-PuurICT/bug/PrimaryQueryResultIsNull
Browse files Browse the repository at this point in the history
Add null check for PrimaryQueryResult in SharePointSearchService
  • Loading branch information
wobba authored Nov 22, 2024
2 parents fd372ff + facefba commit 890cb7c
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ export class SharePointSearchService implements ISharePointSearchService {
if (response.ok) {

const searchResponse: ISharePointSearchResponse = await response.json();
if (searchResponse.PrimaryQueryResult) {
const refinementResultsRows = searchResponse.PrimaryQueryResult.RefinementResults;
const refinementRows: any = refinementResultsRows ? refinementResultsRows.Refiners : [];

Expand All @@ -237,7 +238,7 @@ export class SharePointSearchService implements ISharePointSearchService {
});
});
});

}
} else {
throw new Error(`${response['statusMessage']}`);
}
Expand Down

0 comments on commit 890cb7c

Please sign in to comment.