Merge pull request #1268 from danamlund/fix-unlikely-findunit-segfault

Fix unlikely GUI::getAnyUnit segfault
develop
Lethosor 2018-05-11 23:53:17 -04:00 committed by GitHub
commit 98e81ab245
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

@ -955,7 +955,7 @@ df::unit *Gui::getAnyUnit(df::viewscreen *top)
if (VIRTUAL_CAST_VAR(screen, df::viewscreen_announcelistst, top)) if (VIRTUAL_CAST_VAR(screen, df::viewscreen_announcelistst, top))
{ {
if (screen->unit) { if (world && screen->unit) {
// in (r)eports -> enter // in (r)eports -> enter
auto *report = vector_get(screen->reports, screen->sel_idx); auto *report = vector_get(screen->reports, screen->sel_idx);
if (report) if (report)