jamesrwhite / minicron

🕰️ Monitor your cron jobs
GNU General Public License v3.0
2.34k stars 154 forks source link

Deleting a job causes alerts view to fail #240

Closed JonasBonno closed 7 years ago

JonasBonno commented 8 years ago

Is this only me? Are there a fix or workaround?

NoMethodError at /alerts undefined method `id' for nil:NilClass Ruby /opt/minicron/lib/vendor/ruby/2.2.0/gems/minicron-0.9.6.1467466137/lib/minicron/hub/views/alerts/index.erb: in block (2 levels) in singleton class, line 22 Web GET [MinicronServerURL]/alerts

Line 22: #{route_prefix}/job/#{alert.job.id}" %>"> <%= alert.job.safe_name % (deleted some of the <> due to github reading them)

JonasBonno commented 8 years ago

If I delete the schedules in a job and thereafter deletes the job then everything is fine. Alerts can't handle deleting jobs with schedules.

jamesrwhite commented 8 years ago

Interesting, thanks for looking into it a bit more, very helpful :)

jamesrwhite commented 7 years ago

From what I can see I've fixed this in 0.9.7, please re-open this if it's not the case.