diff --git a/src/GUI/src/Display/SFML.cpp b/src/GUI/src/Display/SFML.cpp index 3361290e..337770f1 100644 --- a/src/GUI/src/Display/SFML.cpp +++ b/src/GUI/src/Display/SFML.cpp @@ -96,15 +96,8 @@ namespace GUI { void SFML::createWindow() { - bool isIconLoad = true; - try { - _icon.loadFromFile(iconPath); - } catch (const std::exception &e) { - std::cerr << e.what() << std::endl; - isIconLoad = false; - } _window.create(sf::VideoMode(_width, _height), _windowTitle, _winStyle); - if (isIconLoad) { + if (_icon.loadFromFile(iconPath)) { _window.setIcon(_icon.getSize().x, _icon.getSize().y, _icon.getPixelsPtr()); } _window.setFramerateLimit(_framerateLimit);