From 45d2d3993eaf0c646fca42138ce62dddcd01d314 Mon Sep 17 00:00:00 2001 From: Jindrich Pilar Date: Mon, 10 Feb 2020 20:44:40 +0100 Subject: [PATCH] Fix parseOutput undefined property (closes #90) --- src/Wsdl/WebService.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Wsdl/WebService.php b/src/Wsdl/WebService.php index 0cf78da..ddf932f 100644 --- a/src/Wsdl/WebService.php +++ b/src/Wsdl/WebService.php @@ -152,13 +152,17 @@ protected function prepareArgs(string $functionName, array $arguments): array */ protected function parseOutput(string $fname, $ret): array { + if (!$ret) { + return []; + } + //pokud obsahuje Output tak vždy vrací pole i s jedním prvkem. - $result = $ret->{$fname . 'Result'}; + $result = $ret->{$fname . 'Result'} ?? null; if (!isset($result)) { return $ret; } - $output = $result->{$fname . 'Output'}; + $output = $result->{$fname . 'Output'} ?? null; if (!isset($output)) { return $result; //neobsahuje $fname.Output }