Skip to content

Commit

Permalink
Harden Test-Path when inserting user markdown (closes #160)
Browse files Browse the repository at this point in the history
  • Loading branch information
bravo-kernel committed Apr 16, 2023
1 parent 7a354bf commit aea0b80
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Source/Private/InsertUserMarkdown.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function InsertUserMarkdown() {
$content = ReadFile -MarkdownFile $MarkdownFile -Raw

# use file content as markdown
if (Test-Path $Markdown -ErrorAction SilentlyContinue) {
if ( $(try { Test-Path $Markdown.Trim() } catch { $false }) ) {
$Markdown = Get-Content -Path $Markdown -Raw
}

Expand Down

0 comments on commit aea0b80

Please sign in to comment.