Browse Source

LibGUI: Skip non-font files in the FontDatabase constructor

Tibor Nagy 5 năm trước cách đây
mục cha
commit
cebf6a7039
1 tập tin đã thay đổi với 3 bổ sung0 xóa
  1. 3 0
      Libraries/LibGUI/FontDatabase.cpp

+ 3 - 0
Libraries/LibGUI/FontDatabase.cpp

@@ -52,6 +52,9 @@ FontDatabase::FontDatabase()
     }
     while (di.has_next()) {
         String name = di.next_path();
+        if (!name.ends_with(".font"))
+            continue;
+
         auto path = String::format("/res/fonts/%s", name.characters());
         if (auto font = Gfx::Font::load_from_file(path)) {
             Metadata metadata;