Skip to content

Commit 566ffdd

Browse files
committed
Calculator: Fix overflow
1 parent 15208e5 commit 566ffdd

File tree

1 file changed

+2
-3
lines changed
  • Plugins/Flow.Launcher.Plugin.Calculator

1 file changed

+2
-3
lines changed

Plugins/Flow.Launcher.Plugin.Calculator/Main.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,11 @@ public List<Result> Query(Query query)
8585

8686
return new List<Result>
8787
{
88-
new Result
89-
{
88+
new() {
9089
Title = newResult,
9190
IcoPath = "Images/calculator.png",
9291
Score = 300,
93-
SubTitle = "0x" + ((int)roundedResult).ToString("X"),
92+
SubTitle = (roundedResult > long.MaxValue || roundedResult < long.MinValue) ? string.Empty : "0x" + ((long)roundedResult).ToString("X"),
9493
CopyText = newResult,
9594
Action = c =>
9695
{

0 commit comments

Comments
 (0)