Skip to content

Commit ebe1846

Browse files
committed
fix: Add null check for readyTasks array access
Fixes TypeScript error TS2532 where readyTasks[0] could be undefined. Added explicit check for readyTasks[0] existence alongside length check.
1 parent b53b566 commit ebe1846

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/loop.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ export async function runLoop(options: LoopOptions = {}): Promise<void> {
282282
let nextTaskDetails: DexTaskDetails | null = null;
283283
try {
284284
readyTasks = await dex.listReady();
285-
if (readyTasks.length > 0) {
285+
if (readyTasks.length > 0 && readyTasks[0]) {
286286
nextTaskDetails = await dex.show(readyTasks[0].id);
287287
}
288288
} catch (error) {

0 commit comments

Comments
 (0)