Permalink
Browse files

Earlier, clearer failure in uilist in test mode

uilist doesn't work in test mode (because curses isn't set up).
Previously this manifested as a segfault.  Instead, check for the
failure sooner and provide a better error message.
  • Loading branch information...
jbytheway committed Jan 3, 2019
1 parent e354022 commit 20fd5aec10fb06af600a3ecd9b1f4f7582e6c381
Showing with 4 additions and 0 deletions.
  1. +4 −0 src/ui.cpp
@@ -517,6 +517,10 @@ void uilist::setup()
scrollbar_auto = false;
}
window = catacurses::newwin( w_height, w_width, w_y, w_x );
if( !window ) {
debugmsg( "Window not created; probably trying to use uilist in test mode." );
abort();
}

fselected = selected;
if(fselected < 0) {

0 comments on commit 20fd5ae

Please sign in to comment.