diff --git a/app/controllers/conference_registrations_controller.rb b/app/controllers/conference_registrations_controller.rb index d7d111ca..34a1effd 100644 --- a/app/controllers/conference_registrations_controller.rb +++ b/app/controllers/conference_registrations_controller.rb @@ -87,7 +87,9 @@ class ConferenceRegistrationsController < ApplicationController def destroy tickets_purchased = TicketPurchase.find_by(conference_id: @registration.conference_id) if @registration.destroy - tickets_purchased.destroy + if tickets_purchased + tickets_purchased.destroy + end redirect_to root_path, notice: "You are not registered for #{@conference.title} anymore!" else