Skip to content

Commit d7cf820

Browse files
committed
fix: add code rabbit suggestion
1 parent 110b2ec commit d7cf820

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

apps/api/src/instrument-records/instrument-records.service.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ type ExpandDataType =
3939
};
4040

4141
function afterFirstDollar(str: string) {
42+
if (!str) return str;
4243
const match = /\$(.*)/.exec(str);
4344
if (!match) return str;
4445
if (!match[1]) return str;

apps/web/src/hooks/useInstrumentVisualization.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ export function useInstrumentVisualization({ params }: UseInstrumentVisualizatio
3737
const [instrumentId, setInstrumentId] = useState<null | string>(null);
3838

3939
function afterFirstDollar(str: string) {
40+
if (!str) return str;
4041
const match = /\$(.*)/.exec(str);
4142
if (!match) return str;
4243
if (!match[1]) return str;

0 commit comments

Comments
 (0)