Skip to content

Commit 3bafa50

Browse files
committed
fix(dev): safe check for remainingIterations
1 parent 14593a9 commit 3bafa50

File tree

1 file changed

+2
-2
lines changed
  • packages/core/src/amazonqFeatureDev/controllers/chat

1 file changed

+2
-2
lines changed

packages/core/src/amazonqFeatureDev/controllers/chat/controller.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -491,15 +491,15 @@ export class FeatureDevController {
491491
if (isStoppedGeneration) {
492492
this.messenger.sendAnswer({
493493
message:
494-
remainingIterations === 0
494+
(remainingIterations ?? 0) <= 0
495495
? "I stopped generating your code. You don't have more iterations left, however, you can start a new session."
496496
: `I stopped generating your code. If you want to continue working on this task, provide another description. You have ${remainingIterations} out of ${totalIterations} code generations left.`,
497497
type: 'answer-part',
498498
tabID: message.tabID,
499499
})
500500
}
501501

502-
if ((remainingIterations === 0 && isStoppedGeneration) || !isStoppedGeneration) {
502+
if (((remainingIterations ?? 0) <= 0 && isStoppedGeneration) || !isStoppedGeneration) {
503503
this.messenger.sendAnswer({
504504
type: 'system-prompt',
505505
tabID: message.tabID,

0 commit comments

Comments
 (0)