From d09db070d00e2b62a6caf2bc9513725cb7e9adc3 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Thu, 22 Jan 2015 16:38:15 +0100 Subject: [PATCH] FlattenToForm: Zugriff auf nicht definierte Variable verhindern Passierte, wenn bei Rechnung das Lieferdatum in den Positionen leer war. --- SL/DB/Helper/FlattenToForm.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/SL/DB/Helper/FlattenToForm.pm b/SL/DB/Helper/FlattenToForm.pm index 0b2c5e93e..4dca557f9 100644 --- a/SL/DB/Helper/FlattenToForm.pm +++ b/SL/DB/Helper/FlattenToForm.pm @@ -72,8 +72,9 @@ sub flatten_to_form { _copy_custom_variables($item, $form, 'ic_cvar_', "_${idx}"); if (ref($self) eq 'SL::DB::Invoice') { - $form->{"deliverydate_oe_${idx}"} = $item->deliverydate->to_lxoffice; - $form->{"reqdate_${idx}"} = $item->deliverydate->to_lxoffice; + my $date = $item->deliverydate ? $item->deliverydate->to_lxoffice : undef; + $form->{"deliverydate_oe_${idx}"} = $date; + $form->{"reqdate_${idx}"} = $date; } } -- 2.20.1