Permalink
Browse files

Don't try to create links to tickets we don't know about

They are probably wrong
  • Loading branch information...
afresh1 committed Aug 12, 2012
1 parent 098ff22 commit 6826f19f69844f5b110886cd514328e6783e82f0
Showing with 6 additions and 4 deletions.
  1. +6 −4 rt-ticket-importer
View
@@ -349,15 +349,17 @@ sub import_link {
my $base = $link->{Base};
$base =~ /([0-9]*)$/;
- $base = $1;
+ $base = $E{Tickets}{$1};
my $target = $link->{Target};
$target =~ /([0-9]*)$/;
- $target = $1;
+ $target = $E{Tickets}{$1};
+
+ return unless $base and $target;
my $linkObj = new RT::Link($RT::SystemUser);
my $newid = $linkObj->Create(
- Base => $E{Tickets}{$base},
- Target => $E{Tickets}{$target},
+ Base => $base,
+ Target => $target,
Type => $link->{Type}
);

0 comments on commit 6826f19

Please sign in to comment.