PowerToys Run crashes at Context Menu button rendering

Created on 29 Jun 2020  路  5Comments  路  Source: microsoft/PowerToys

Steps to reproduce


Unable to repro reliably, but I had done the following while debugger was attached:

  • Did some test search strings like a, b etc and scrolled through all the results
  • Searched 1+1 and then typed = and removed =

Expected behavior


Results should show.

Actual behavior


Exception thrown at https://github.com/microsoft/PowerToys/blob/f46b876fd68a883555aa7f151381e05a4d91804e/src/modules/launcher/Wox/ViewModel/ResultViewModel.cs#L73 I think the exception was ContextMenuItems was null, which means LoadContextMenu in the previous line failed for some reason.

Issue-Bug Product-Launcher Resolution-Fix-Committed

All 5 comments

@arjunbalgovind I was able to re-create this with the steps you provided and by using the arrow keys.

ActivateContextButtons() checks if the ContextMenuItems are not null. Not doing that in DeactivateContextButtons() so I'm guessing the error actually showed up in:

https://github.com/microsoft/PowerToys/blob/f46b876fd68a883555aa7f151381e05a4d91804e/src/modules/launcher/Wox/ViewModel/ResultViewModel.cs#L118 ?

For now, we'd need to revert #4537 (@crutkas ). Apologies for not checking this properly.

I would guess the fix then would be to just add a null check before checking count right @niels9001 ?

if we can add a null check and verify, lets do that

Thanks for finding the cause @niels9001! Added a null check to fix the issue.

Fixed in 0.19.0, please visit https://github.com/microsoft/PowerToys/releases/ for the latest release

Was this page helpful?
0 / 5 - 0 ratings

Related issues

SWinxy picture SWinxy  路  3Comments

amorenew picture amorenew  路  3Comments

xfirf picture xfirf  路  3Comments

enricogior picture enricogior  路  3Comments

patware picture patware  路  3Comments