Skip to content

Commit bfa995e

Browse files
author
Hermes Agent (gankoji-openclaw)
committed
Fix TS2531: Object is possibly null for rowCount
- rmq.service.ts: Use ?? 0 to handle nullable rowCount - postgres-server.ts: Use ?? 0 to handle nullable rowCount
1 parent f41ab84 commit bfa995e

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

common/src/events/rmq.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ export class RmqService {
125125
`,
126126
[daysToKeep],
127127
);
128-
if (result.rowCount > 0) {
128+
if ((result.rowCount ?? 0) > 0) {
129129
this.logger.log(`Cleaned up ${result.rowCount} old events older than ${daysToKeep} days`);
130130
}
131131
return result.rowCount ?? 0;

common/src/postgres-transport/postgres-server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export class PostgresServer extends Server implements CustomTransportStrategy {
7272
`,
7373
[Math.ceil(this.staleMessageTimeoutMs / 1000)],
7474
);
75-
if (result.rowCount > 0) {
75+
if ((result.rowCount ?? 0) > 0) {
7676
this.logger.warn(`Reset ${result.rowCount} stale processing messages to pending`);
7777
}
7878
} catch (error) {

0 commit comments

Comments
 (0)