Skip to content

Commit 51baba2

Browse files
committed
gui: check for nullptr in gif add/end
Signed-off-by: Matt Liberty <[email protected]>
1 parent e42920f commit 51baba2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/gui/src/gui.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1467,7 +1467,7 @@ void Gui::gifAddFrame(const int key,
14671467
double dbu_per_pixel,
14681468
std::optional<int> delay)
14691469
{
1470-
if (key >= gifs_.size()) {
1470+
if (key >= gifs_.size() || gifs_[key] == nullptr) {
14711471
logger_->warn(utl::GUI, 51, "GIF not active");
14721472
return;
14731473
}
@@ -1551,7 +1551,7 @@ void Gui::gifAddFrame(const int key,
15511551

15521552
void Gui::gifEnd(const int key)
15531553
{
1554-
if (key >= gifs_.size()) {
1554+
if (key >= gifs_.size() || gifs_[key] == nullptr) {
15551555
logger_->warn(utl::GUI, 58, "GIF not active");
15561556
return;
15571557
}

0 commit comments

Comments
 (0)