Skip to content

Commit

Permalink
gui: Null check file_ before setting format
Browse files Browse the repository at this point in the history
  • Loading branch information
JJL772 committed Jun 10, 2024
1 parent 662ddc9 commit ffca4f9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/gui/document.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,9 @@ bool Document::load_file_internal(const void* data, size_t size) {
}

void Document::set_format(VTFImageFormat format) {
if (!file_)
return;

if (format == file_->GetFormat()) {
format_ = IMAGE_FORMAT_NONE;
return;
Expand Down

0 comments on commit ffca4f9

Please sign in to comment.