my $source = $prog ? read_file $prog->path : $_{source_code};
unlink $prog->path if $prog;
my $private = (problem->private && !$_{contest}) ? 1 : 0;
- $private = 1 if contest->is_pending;
+ $private = 1 if contest && contest->is_pending;
my $newjob = db->jobs->create({
maybe contest => $_{contest},
private => $private,