Skip to content
This repository was archived by the owner on Jul 22, 2025. It is now read-only.

Commit 1163977

Browse files
committed
lint and fix
1 parent f9ee33f commit 1163977

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

app/controllers/discourse_ai/ai_bot/artifacts_controller.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ def show
2626
raise Discourse::NotFound if !artifact
2727
end
2828

29-
js = artifact.js
30-
if !artifact.js.match?(%r{\A\s*<script.*</script>}mi)
29+
js = artifact.js || ""
30+
if !js.match?(%r{\A\s*<script.*</script>}mi)
3131
mod = ""
3232
mod = " type=\"module\"" if js.match?(/\A\s*import.*/)
3333
js = "<script#{mod}>\n#{js}\n</script>"

0 commit comments

Comments
 (0)