Skip to content

Commit

Permalink
null check on $ContentTypes (OpenAPITools#9687)
Browse files Browse the repository at this point in the history
  • Loading branch information
wing328 authored Jun 8, 2021
1 parent 7125ef4 commit 37b7c80
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,10 @@ function DeserializeResponse {
[string[]]$ContentTypes
)
If ($ContentTypes -eq $null) {
$ContentTypes = [string[]]@()
}

If ([string]::IsNullOrEmpty($ReturnType) -and $ContentTypes.Count -eq 0) { # void response
return $Response
} Elseif ($ReturnType -match '\[\]$') { # array
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,10 @@ function DeserializeResponse {
[string[]]$ContentTypes
)

If ($ContentTypes -eq $null) {
$ContentTypes = [string[]]@()
}

If ([string]::IsNullOrEmpty($ReturnType) -and $ContentTypes.Count -eq 0) { # void response
return $Response
} Elseif ($ReturnType -match '\[\]$') { # array
Expand Down

0 comments on commit 37b7c80

Please sign in to comment.