DN: niemals leere Strings als ids verwenden
authorSven Schöling <s.schoeling@linet-services.de>
Fri, 4 Nov 2016 12:41:09 +0000 (13:41 +0100)
committerSven Schöling <s.schoeling@linet-services.de>
Fri, 4 Nov 2016 12:41:44 +0000 (13:41 +0100)
SL/DN.pm

index 9273bf5..69db005 100644 (file)
--- a/SL/DN.pm
+++ b/SL/DN.pm
@@ -475,11 +475,11 @@ sub set_template_options {
   # prepare meta information for template introspection
   $form->{template_meta} = {
     formname  => $form->{formname},
-    language  => SL::DB::Manager::Language->find_by_or_create(id => $form->{language_id}),
+    language  => SL::DB::Manager::Language->find_by_or_create(id => $form->{language_id} || undef),
     format    => $form->{format},
     media     => $form->{media},
     extension => $extension,
-    printer   => SL::DB::Manager::Printer->find_by_or_create(id => $form->{printer_id}),
+    printer   => SL::DB::Manager::Printer->find_by_or_create(id => $form->{printer_id} || undef),
     today     => DateTime->today,
   };