FIX: Do not try to show logo if it does not exist (#12968)

FIX: Do not try to show logo if it does not exist (#12968)

The generator tried to include the logo in the certificate, even when it did not exist and that caused a server error.

diff --git a/plugins/discourse-narrative-bot/lib/discourse_narrative_bot/templates/advanced_user.svg.erb b/plugins/discourse-narrative-bot/lib/discourse_narrative_bot/templates/advanced_user.svg.erb
index 9c06ce3..000fba0 100644
--- a/plugins/discourse-narrative-bot/lib/discourse_narrative_bot/templates/advanced_user.svg.erb
+++ b/plugins/discourse-narrative-bot/lib/discourse_narrative_bot/templates/advanced_user.svg.erb
@@ -46,9 +46,11 @@
   <text x="<%= @width / 2 %>" y="270" text-anchor="middle" fill="#020403" font-family="'Tangerine'" font-size="34.8841px">
     <%= @name %>
   </text>
-  <g transform="translate(<%= @logo_group[:width] / 2 - (@logo_group[:size] / 2) %> <%= @logo_group[:height] %>)">
-    <image height="<%= @logo_group[:size] %>px" width="<%= @logo_group[:size] %>px" href="<%= @logo_group[:logo_uri] %>"/>
-  </g>
+  <% if @logo_group.present? %>
+    <g transform="translate(<%= @logo_group[:width] / 2 - (@logo_group[:size] / 2) %> <%= @logo_group[:height] %>)">
+      <image height="<%= @logo_group[:size] %>px" width="<%= @logo_group[:size] %>px" href="<%= @logo_group[:logo_uri] %>"/>
+    </g>
+  <% end %>
   <g>
     <g fill="#8CC63F">

[... diff too long, it was truncated ...]

GitHub sha: 05ac4f40

This commit appears in #12968 which was approved by eviltrout. It was merged by nbianca.