ShippedQty-Helper: undef-Warnung vermeiden
authorBernd Bleßmann <bernd@kivitendo-premium.de>
Thu, 9 Sep 2021 09:56:06 +0000 (11:56 +0200)
committerBernd Bleßmann <bernd@kivitendo-premium.de>
Fri, 10 Sep 2021 13:08:59 +0000 (15:08 +0200)
SL/Helper/ShippedQty.pm

index 383a3a3..6b878a9 100644 (file)
@@ -162,9 +162,9 @@ sub init_require_stock_out    { $::instance_conf->get_shipped_qty_require_stock_
 
 sub init_services_deliverable  {
   my ($self) = @_;
-  if ($::form->{type} =~ m/^sales_/ || $self->{objects}->[0]->{customer_id}) {
+  if (($::form->{type}//'') =~ m/^sales_/ || $self->{objects}->[0]->{customer_id}) {
     $::instance_conf->get_sales_delivery_order_check_service;
-  } elsif ($::form->{type} =~ m/^purchase_/ || $self->{objects}->[0]->{vendor_id}) {
+  } elsif (($::form->{type}//'') =~ m/^purchase_/ || $self->{objects}->[0]->{vendor_id}) {
     $::instance_conf->get_purchase_delivery_order_check_service;
   } else {
     croak "wrong call, no customer or vendor object referenced";