Commit 0efdc94 1 parent b6b941c commit 0efdc94 Copy full SHA for 0efdc94
File tree 1 file changed +13
-2
lines changed
src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.Calculator
1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change 13
13
using Microsoft . PowerToys . Run . Plugin . Calculator . Properties ;
14
14
using Microsoft . PowerToys . Settings . UI . Library ;
15
15
using Wox . Plugin ;
16
+ using Wox . Plugin . Logger ;
16
17
17
18
namespace Microsoft . PowerToys . Run . Plugin . Calculator
18
19
{
@@ -212,8 +213,18 @@ public void UpdateSettings(PowerLauncherPluginSettings settings)
212
213
var optionReplaceInput = settings . AdditionalOptions . FirstOrDefault ( x => x . Key == ReplaceInput ) ;
213
214
replaceInput = optionReplaceInput ? . Value ?? replaceInput ;
214
215
215
- var optionTrigMode = settings . AdditionalOptions . FirstOrDefault ( x => x . Key == TrigMode ) ;
216
- trigMode = ( CalculateEngine . TrigMode ) int . Parse ( optionTrigMode . ComboBoxValue . ToString ( CultureInfo . InvariantCulture ) , CultureInfo . InvariantCulture ) ;
216
+ try
217
+ {
218
+ var optionTrigMode = settings . AdditionalOptions . FirstOrDefault ( x => x . Key == TrigMode ) ;
219
+ if ( optionTrigMode != null )
220
+ {
221
+ trigMode = ( CalculateEngine . TrigMode ) int . Parse ( optionTrigMode . ComboBoxValue . ToString ( CultureInfo . InvariantCulture ) , CultureInfo . InvariantCulture ) ;
222
+ }
223
+ }
224
+ catch ( Exception ex )
225
+ {
226
+ Log . Exception ( "Error while trying to load Trigonometry Mode setting: {ex.Message}" , ex , GetType ( ) ) ;
227
+ }
217
228
}
218
229
219
230
_inputUseEnglishFormat = inputUseEnglishFormat ;
You can’t perform that action at this time.
0 commit comments