Merge branch 'master' of vc.linet-services.de:public/lx-office-erp
[kivitendo-erp.git] / SL / Template / OpenDocument.pm
index 552bc2f..12a7bc8 100644 (file)
@@ -37,7 +37,7 @@ sub parse_foreach {
 
   my $ary = $self->_get_loop_variable($var, 1, @indices);
 
-  for (my $i = 0; $i < scalar(@{$ary}); $i++) {
+  for (my $i = 0; $i < scalar(@{$ary || []}); $i++) {
     $form->{"__first__"} = $i == 0;
     $form->{"__last__"} = ($i + 1) == scalar(@{$ary});
     $form->{"__odd__"} = (($i + 1) % 2) == 1;
@@ -389,7 +389,7 @@ sub spawn_xvfb {
 
   local *OUT;
   my $dfname = $self->{"userspath"} . "/xvfb_display";
-  if (!open(OUT, ">$dfname")) {
+  if (!open(OUT, ">", $dfname)) {
     $self->{"error"} = "Conversion to PDF failed because OpenOffice could not be started ($dfname: $!)";
     unlink($xauthority);
     kill($pid);