Skip to content

Commit f900b29

Browse files
atrakhConvex, Inc.
authored andcommitted
dashboard: dont render scheduled fn args if they arent set (#43826)
GitOrigin-RevId: 0950bbe8994e3f6aac59481920e28cebd17eaf47
1 parent d6120c4 commit f900b29

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

npm-packages/dashboard-common/src/features/schedules/components/ScheduledFunctionsListItem.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,9 @@ function JobItemImpl({
8181
throw new Error("Could not find timestamp to run scheduled job at");
8282
}
8383
const date = new Date(Number(nextTs / BigInt(1000000))).toLocaleString();
84-
const udfArgsParsed: JSONValue[] = JSON.parse(
85-
Buffer.from(udfArgs).toString("utf8"),
86-
);
84+
const udfArgsParsed: JSONValue[] = udfArgs
85+
? JSON.parse(Buffer.from(udfArgs).toString("utf8"))
86+
: null;
8787
if (_id === null) {
8888
throw new Error("Scheduled job id is null");
8989
}
@@ -147,7 +147,9 @@ function JobItemImpl({
147147
variant: "neutral",
148148
}}
149149
>
150-
<MenuItem action={() => setShowArgs(true)}>View Arguments</MenuItem>
150+
<MenuItem action={() => setShowArgs(true)} disabled={!udfArgs}>
151+
View Arguments
152+
</MenuItem>
151153
<MenuItem
152154
action={() => setShowDeleteModal(true)}
153155
disabled={currentlyRunning || !canCancelJobs}

0 commit comments

Comments
 (0)