mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-06-07 01:08:18 +08:00
Fixes null reference exception. (#3436)
This commit is contained in:
parent
302df56ee1
commit
e8c5f3a882
@ -38,6 +38,12 @@ namespace Microsoft.Plugin.Calculator
|
||||
{
|
||||
var result = MagesEngine.Interpret(query.Search);
|
||||
|
||||
// This could happen for some incorrect queries, like pi(2)
|
||||
if(result == null)
|
||||
{
|
||||
return new List<Result>();
|
||||
}
|
||||
|
||||
if (result.ToString() == "NaN")
|
||||
result = Context.API.GetTranslation("wox_plugin_calculator_not_a_number");
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user