diff --git a/xwords4/wasm/main.c b/xwords4/wasm/main.c index 97a7fffe2..48a1560cc 100644 --- a/xwords4/wasm/main.c +++ b/xwords4/wasm/main.c @@ -821,18 +821,19 @@ updateDeviceButtons( Globals* globals ) { const char* buttons[MAX_BUTTONS]; int cur = 0; - if ( 0 < countDicts( globals ) ) { - buttons[cur++] = BUTTON_GAME_NEW; - } if ( 0 < countGames(globals) ) { buttons[cur++] = BUTTON_GAME_OPEN; } + if ( 0 < countDicts( globals ) ) { + buttons[cur++] = BUTTON_GAME_NEW; + } if ( !!getCurGame( globals ) ) { buttons[cur++] = BUTTON_GAME_RENAME; buttons[cur++] = BUTTON_GAME_DELETE; } buttons[cur++] = BUTTON_NAME; buttons[cur++] = NULL; + XP_ASSERT( cur <= VSIZE(buttons) ); setButtons( BUTTONS_ID_DEVICE, buttons, onDeviceButton, globals ); }