Avoid error in case provided reseller code is invalid

This commit is contained in:
Björn Fromme
2018-06-28 15:45:50 +02:00
parent b908d9c0de
commit 3255587f1f
2 changed files with 16 additions and 10 deletions
@@ -63,9 +63,13 @@ class ResellerController extends ActionController
/** /**
* @param Reseller $reseller * @param Reseller $reseller
*/ */
public function listAction(Reseller $reseller) public function listAction(Reseller $reseller = null)
{ {
$products = [];
if ($reseller !== null) {
$products = $reseller->getProducts(); $products = $reseller->getProducts();
}
$this->view->assign('reseller', $reseller); $this->view->assign('reseller', $reseller);
$this->view->assign('products', $products); $this->view->assign('products', $products);
@@ -8,6 +8,7 @@
<div class="container"> <div class="container">
<div class="row"> <div class="row">
<div class="col-xs-12"> <div class="col-xs-12">
<f:if condition="{reseller}">
<h2>Gesamtexport XML</h2> <h2>Gesamtexport XML</h2>
<f:link.action arguments="{reseller: reseller}" pageType="1972" target="_blank">Export XML</f:link.action> <f:link.action arguments="{reseller: reseller}" pageType="1972" target="_blank">Export XML</f:link.action>
<h2>Einzelexport Excel</h2> <h2>Einzelexport Excel</h2>
@@ -16,6 +17,7 @@
<li><f:link.action arguments="{product: product, reseller: reseller}" pageType="1984">Export XLS: {product.name}</f:link.action></li> <li><f:link.action arguments="{product: product, reseller: reseller}" pageType="1984">Export XLS: {product.name}</f:link.action></li>
</f:for> </f:for>
</ul> </ul>
</f:if>
</div> </div>
</div> </div>
</div> </div>