Skip to content

Commit c3d5f9e

Browse files
committed
Fix squeeze error handling
1 parent ac15fa0 commit c3d5f9e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

backend/src/models/shortsqueeze/shortsqueeze.service.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,11 @@ export class ShortsqueezeService {
1414
return this.squeezeRepository.set(stockTicker, data);
1515
}
1616

17-
async fetch(stockTicker: string): Promise<IShortsqueeze> {
17+
async fetch(stockTicker: string): Promise<IShortsqueeze | null> {
1818
const squeeze = await shortsqueeze(stockTicker);
19+
if (!squeeze) {
20+
return null;
21+
}
1922

2023
return {
2124
shortFlow: squeeze ? squeeze.shortPercentOfFloat : undefined,

0 commit comments

Comments
 (0)