diff --git a/app/jobs/hyrax/doi/register_doi_job.rb b/app/jobs/hyrax/doi/register_doi_job.rb index 153a3dd9..8c78ab8e 100644 --- a/app/jobs/hyrax/doi/register_doi_job.rb +++ b/app/jobs/hyrax/doi/register_doi_job.rb @@ -14,6 +14,8 @@ class RegisterDOIJob < ApplicationJob # @param registrar [String] Note this is a string and not a symbol because ActiveJob cannot serialize a symbol # @param registrar_opts [Hash] def perform(model, registrar: Hyrax.config.identifier_registrars.keys.first, registrar_opts: {}) + return if model.doi.blank? + Hyrax::Identifier::Dispatcher .for(registrar.to_sym, **registrar_opts) .assign_for!(object: model, attribute: :doi)