<% ns = notification_subscription %>
<tr>
  <td><%= link_to ns.user.name, admin_system_user_path(ns.user) %></td>
  <td><%= ns.user.affiliate %></td>
  <td><code><%= ns.event_type %></code></td>
  <td class="text-center"><%= tick(ns.email) %></td>
  <td class="text-center"><%= tick(ns.sms) %></td>
  <td class="text-center"><%= tick(ns.web_push) %></td>
  <td class="text-center"><%= tick(ns.mobile_push) %></td>
  <td class="text-center"><%= tick(ns.slack) %></td>
  <td class="text-right">
    <%= link_to "edit", edit_admin_system_notification_subscription_path(ns, ret: request.fullpath) %> &nbsp;
    <%= link_to "delete",
                admin_system_notification_subscription_path(ns),
                method: :delete,
                data: {confirm: "Are you sure?"} %>
  </td>
</tr>
<% ns = notification_subscription %>
<tr>
  <td>
    <% if ns.user %>
      <%= link_to ns.user.name, admin_system_user_path(ns.user) %>
    <% else %>
      User ID: <%= ns.user_id %>
    <% end  %>
  </td>
  <td><%= ns.user&.affiliate %></td>
  <td><code><%= ns.event_type %></code></td>
  <td class="text-center"><%= tick(ns.email) %></td>
  <td class="text-center"><%= tick(ns.sms) %></td>
  <td class="text-center"><%= tick(ns.web_push) %></td>
  <td class="text-center"><%= tick(ns.mobile_push) %></td>
  <td class="text-center"><%= tick(ns.slack) %></td>
  <td class="text-right">
    <%= link_to "edit", edit_admin_system_notification_subscription_path(ns, ret: request.fullpath) %> &nbsp;
    <%= link_to "delete",
                admin_system_notification_subscription_path(ns),
                method: :delete,
                data: {confirm: "Are you sure?"} %>
  </td>
</tr>
Fix null user in notification subscriptions
Fix null user in notification subscriptions
