Skip to content

Commit 33ad8cc

Browse files
authored
fix: wrong source getting (#1624)
1 parent c37f6f0 commit 33ad8cc

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/core-base/src/translate.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1125,8 +1125,9 @@ function getSourceForCodeFrame(
11251125
source: string | ResourceNode
11261126
): string | undefined {
11271127
if (isString(source)) {
1128+
return source
11281129
} else {
1129-
if (source.loc?.source) {
1130+
if (source.loc && source.loc.source) {
11301131
return source.loc.source
11311132
}
11321133
}

0 commit comments

Comments
 (0)