Commit 82bf15a3 authored by Matthieu Muffato's avatar Matthieu Muffato
Browse files

bugfix: die if the input_id is not a valid hash

parent f1b97188
......@@ -89,11 +89,18 @@ sub main {
$input_id = '{}';
warn "Since -input_id has not been set, assuming input_id='$input_id'\n";
}
my $dinput_id = destringify($input_id);
if (!ref($dinput_id)) {
die "'$input_id' cannot be eval'ed, likely because of a syntax error\n";
}
if (ref($dinput_id) ne 'HASH') {
die "'$input_id' is not a hash\n";
}
my $job = Bio::EnsEMBL::Hive::AnalysisJob->new(
-prev_job_id => undef, # this job has been created by the initialization script, not by another job
-analysis_id => $analysis->dbID,
-input_id => destringify( $input_id ), # Make sure all job creations undergo re-stringification to avoid alternative "spellings" of the same input_id hash
-input_id => $dinput_id, # Make sure all job creations undergo re-stringification to avoid alternative "spellings" of the same input_id hash
);
my ($job_id) = @{ $hive_dba->get_AnalysisJobAdaptor->store_jobs_and_adjust_counters( [ $job ] ) };
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment