From: Jan Büren Date: Fri, 19 Nov 2021 10:03:58 +0000 (+0100) Subject: get_article, um Rückgabewert erweitert, falls kein Produkt gefunden wurde X-Git-Tag: kivitendo-mebil_0.1-0~10^2~2^2~218^2~26 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=6d4276853d14418f9bfde8d9707984c3343bb12f;p=kivitendo-erp.git get_article, um Rückgabewert erweitert, falls kein Produkt gefunden wurde --- diff --git a/SL/ShopConnector/Shopware6.pm b/SL/ShopConnector/Shopware6.pm index e065176e8..b9d80ef35 100644 --- a/SL/ShopConnector/Shopware6.pm +++ b/SL/ShopConnector/Shopware6.pm @@ -581,6 +581,9 @@ sub get_article { } catch { die "Malformed JSON Data: $_ " . $ret->responseContent(); }; + + # maybe no product was found ... + return undef unless scalar @{ $data_json->{data} } > 0; # caller wants this structure: # $stock_onlineshop = $shop_article->{data}->{mainDetail}->{inStock}; # $active_online = $shop_article->{data}->{active};