diff --git a/lib/svg_sprite/svg_sprite.rb b/lib/svg_sprite/svg_sprite.rb
index efdb832531a..fd2d688b722 100644
--- a/lib/svg_sprite/svg_sprite.rb
+++ b/lib/svg_sprite/svg_sprite.rb
@@ -365,7 +365,7 @@ License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL
svg_file = Nokogiri::XML(File.open(fname))
svg_file.css('symbol').each do |sym|
- icons << sym.attributes['id'].value
+ icons << sym.attributes['id'].value if sym.attributes['id'].present?
end
end
icons
diff --git a/spec/fixtures/images/custom-theme-icon-sprite.svg b/spec/fixtures/images/custom-theme-icon-sprite.svg
index 23974ecded5..eb3f524768c 100644
--- a/spec/fixtures/images/custom-theme-icon-sprite.svg
+++ b/spec/fixtures/images/custom-theme-icon-sprite.svg
@@ -3,4 +3,7 @@
+
+
+