Skip to content

Commit

Permalink
It's possible that input/import regex has undefined dir and path elem…
Browse files Browse the repository at this point in the history
…ents
  • Loading branch information
James-Yu committed Dec 7, 2024
1 parent 4263608 commit 212e1f1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/utils/inputfilepath.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ enum MatchType {

interface MatchPath {
type: MatchType,
path: string,
directory: string,
path?: string,
directory?: string,
matchedString: string,
index: number
}
Expand Down Expand Up @@ -90,8 +90,8 @@ export class InputFileRegExp {
const rawTexDirs = vscode.workspace.getConfiguration('latex-workshop').get('latex.texDirs') as string[]
const texDirs = rawTexDirs.map((texDir) => {return replaceArgumentPlaceholders('', '')(texDir)})

const matchedDir = sanitizeInputFilePath(match.directory)
const matchedPath = sanitizeInputFilePath(match.path)
const matchedDir = sanitizeInputFilePath(match.directory ?? '')
const matchedPath = sanitizeInputFilePath(match.path ?? '')
/* match of this.childReg */
if (match.type === MatchType.Child) {
return resolveFile([path.dirname(currentFile), path.dirname(rootFile), ...texDirs], matchedPath)
Expand Down

0 comments on commit 212e1f1

Please sign in to comment.