Skip to content

Commit

Permalink
Clean up regex match if part number is null
Browse files Browse the repository at this point in the history
  • Loading branch information
jvlflame committed Jul 6, 2020
1 parent cd7b6d2 commit f9d1017
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Javinizer/Private/Convert-JavTitle.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,11 @@ function Convert-JavTitle {
if ($file -match $regex) {
$id = ($file | Select-String $regex).Matches.Groups[1].Value
$partNum = ($file | Select-String $regex).Matches.Groups[2].Value
$fileBaseNameUpper[$counter] = "$id-pt$PartNum"
if ($null -ne $partNum) {
$fileBaseNameUpper[$counter] = "$id-pt$PartNum"
} else {
$fileBaseNameUpper[$counter] = "$id"
}
$counter++
} else {
break
Expand Down

0 comments on commit f9d1017

Please sign in to comment.