diff --git a/src/ui/HUD.cc b/src/ui/HUD.cc index 599eb7bb4b49be6f712c1f09d73ff3626d724993..24dc75de233161f602cd730e9c4b5c4e51f7d04a 100644 --- a/src/ui/HUD.cc +++ b/src/ui/HUD.cc @@ -1361,15 +1361,16 @@ void HUD::copyImage(UASInterface* uas) if (u) { QImage temp_im = u->getImage(); - if (temp_im.byteCount() > 0) { - this->glImage = temp_im; - } - - // Save to directory if logging is enabled - if (imageLoggingEnabled) + if (temp_im.byteCount() > 0) { - u->getImage().save(QString("%1/%2.png").arg(imageLogDirectory).arg(imageLogCounter)); - imageLogCounter++; + this->glImage = temp_im; + + // Save to directory if logging is enabled + if (imageLoggingEnabled) + { + temp_im.save(QString("%1/%2.png").arg(imageLogDirectory).arg(imageLogCounter)); + imageLogCounter++; + } } } }