Cleanup: NULL check pointer before dereferencing

Found by Coverity. CID 350081, 350087, 350095

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2019-10-27 07:28:57 -04:00
parent 08fcda60ac
commit 33137c62b0
2 changed files with 5 additions and 4 deletions

View file

@ -377,7 +377,7 @@ void DiveLogExportDialog::export_TeX(const char *filename, const bool selected_o
dive_site *site = dive->dive_site;
QRegExp ct("countrytag: (\\w+)");
QString country;
if (ct.indexIn(site->notes) >= 0)
if (site && ct.indexIn(site->notes) >= 0)
country = ct.cap(1);
else
country = "";