Browse Source

Fortify against missing purpose

(Humanity could use that)
Alois Mahdal 10 years ago
parent
commit
ef0e500332
1 changed files with 3 additions and 1 deletions
  1. 3
    1
      bin/mkexec

+ 3
- 1
bin/mkexec View File

124
     my $type = shift;
124
     my $type = shift;
125
     my $purpose = shift;
125
     my $purpose = shift;
126
     my $tmpl = "";
126
     my $tmpl = "";
127
-    $tmpl .= $templates->{$type}->{$purpose} if exists $templates->{$type};
127
+    $tmpl .= $templates->{$type}->{$purpose}
128
+        if exists $templates->{$type}
129
+            and exists $templates->{$type}->{$purpose};
128
     return sprintf "#!%s\n%s\n", $bangs->{$type}, $tmpl;
130
     return sprintf "#!%s\n%s\n", $bangs->{$type}, $tmpl;
129
 }
131
 }
130
 
132