Skip to content

Commit

Permalink
GraphQL-474: Cannot return null for non-nullable field SelectedCustom…
Browse files Browse the repository at this point in the history
…izableOptionValue.sort_order and Call to a member function getPriceType() on null
  • Loading branch information
naydav committed Apr 30, 2019
1 parent b115f1c commit 05ea6ef
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ private function extractCustomizableOptions(array $cartItemData): array
$customizableOptionsData = [];
foreach ($cartItemData['customizable_options'] as $customizableOption) {
if (isset($customizableOption['value_string'])) {
$customizableOptionsData[$customizableOption['id']] = $this->convertCustomOptions(
$customizableOptionsData[$customizableOption['id']] = $this->convertCustomOptionValue(
$customizableOption['value_string']
);
}
Expand All @@ -158,10 +158,12 @@ private function createBuyRequest(float $quantity, array $customOptions): DataOb
}

/**
* Convert custom options vakue
*
* @param string $value
* @return string|array
*/
private function convertCustomOptions(string $value)
private function convertCustomOptionValue(string $value)
{
$value = trim($value);
if (substr($value, 0, 1) === "[" &&
Expand Down

0 comments on commit 05ea6ef

Please sign in to comment.