We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e3453ef commit 1e96827Copy full SHA for 1e96827
src/Core/Context.cpp
@@ -163,7 +163,11 @@ std::shared_ptr<Context> Context::GetInstance() {
163
164
void Context::SetWindowIcon(const std::string &path) {
165
SDL_Surface *image = IMG_Load(path.c_str());
166
- SDL_SetWindowIcon(m_Window, image);
167
- SDL_FreeSurface(image);
+ if (image) {
+ SDL_SetWindowIcon(m_Window, image);
168
+ SDL_FreeSurface(image);
169
+ return;
170
+ }
171
+ LOG_ERROR("Failed to load image: {}", path);
172
}
173
} // namespace Core
0 commit comments