diff options
| author | in1tiate <32779090+in1tiate@users.noreply.github.com> | 2024-05-26 15:31:15 -0500 |
|---|---|---|
| committer | in1tiate <32779090+in1tiate@users.noreply.github.com> | 2024-05-26 15:31:15 -0500 |
| commit | 0475b2a045780d2a8ab4ce439a09cf13a52027ef (patch) | |
| tree | 3e1e5a44f8aa50a162476ad6479327d426e0a7a8 /src/animationloader.cpp | |
| parent | 67d5646d7c58eb0700d262672c5cf009d90969bf (diff) | |
Fix invalid file paths causing unexpected behavior
Diffstat (limited to 'src/animationloader.cpp')
| -rw-r--r-- | src/animationloader.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/animationloader.cpp b/src/animationloader.cpp index 5f57cbe5..ae7bfe07 100644 --- a/src/animationloader.cpp +++ b/src/animationloader.cpp @@ -25,6 +25,17 @@ void AnimationLoader::load(const QString &fileName) { return; } + else if (fileName == QObject::tr("Invalid File")) + { + // Set the image to a null pixmap if it's invalid + stopLoading(); + m_size = QSize(1, 1); + m_frames.clear(); + m_frames.append(AnimationFrame(QPixmap(), 0)); + m_frame_count = 1; + m_loop_count = 0; + return; + } stopLoading(); m_file_name = fileName; QImageReader *reader = new QImageReader; |
