diff --git a/src/watcher/watcher.network.ts b/src/watcher/watcher.network.ts index cc10543..c52c742 100644 --- a/src/watcher/watcher.network.ts +++ b/src/watcher/watcher.network.ts @@ -24,7 +24,8 @@ export class WatcherNetwork { async getWatcherHistoricalPrices(req: Request, res: Response): Promise { try { const prices = await this.service.getWatcherHistoryPrices(); - res.json({ prices: JSON.parse(prices) }); + if (!prices || prices.length === 0) res.json({ prices: [] }); + else res.json({ prices: JSON.parse(prices) }); } catch (error) { this.handleErrorResponse(res, error); }