Skip to content

Commit

Permalink
Fixed crash on empty input field (issue #244)
Browse files Browse the repository at this point in the history
  • Loading branch information
Proektsoftbg committed Nov 17, 2023
1 parent f924aa3 commit c6cd044
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 20 deletions.
6 changes: 3 additions & 3 deletions Calcpad.Cli/Calcpad.Cli.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
<Version>6.2.0</Version>
<Authors>Nedelcho Ganchovski</Authors>
<Company>Proektsoft EOOD</Company>
<PackageId>Cli</PackageId>
<Product>Cli</Product>
<AssemblyName>Cli</AssemblyName>
<PackageId>Calcpad</PackageId>
<Product>Calcpad</Product>
<AssemblyName>Calcpad</AssemblyName>
<StartupObject>Calcpad.Cli.Program</StartupObject>
</PropertyGroup>

Expand Down
2 changes: 1 addition & 1 deletion Calcpad.Wpf/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3294,7 +3294,7 @@ private bool ValidateInputFields(string[] fields)
if (j > 0)
s = s[(j + 1)..];
}
if (s[0] == '+' || !double.TryParse(s, NumberStyles.AllowLeadingSign | NumberStyles.AllowDecimalPoint, CultureInfo.InvariantCulture, out var _))
if (s.Length == 0 || s[0] == '+' || !double.TryParse(s, NumberStyles.AllowLeadingSign | NumberStyles.AllowDecimalPoint, CultureInfo.InvariantCulture, out var _))
{
_wbWarper.ReportInputFieldError(i);
return false;
Expand Down
32 changes: 16 additions & 16 deletions Calcpad.Wpf/help.html
Original file line number Diff line number Diff line change
Expand Up @@ -492,22 +492,22 @@
</li>
<li style="list-style-type: none;">
<span class="exp" id="btn9">+</span>Output control:<br />
<span id="list9" style="display: none;">
<a href="#0" data-text="#hide"><span class="cond">#hide</span></a> - hide the report contents;<br />
<a href="#0" data-text="#show"><span class="cond">#show</span></a> - always show the contents (default);<br />
<a href="#0" data-text="#pre"><span class="cond">#pre</span></a> - show the next contents only before calculations;<br />
<a href="#0" data-text="#post"><span class="cond">#post</span></a> - show the next contents only after calculations;<br />
<a href="#0" data-text="#val"><span class="cond">#val</span></a> - show only the final result, without the equation;<br />
<a href="#0" data-text="#equ"><span class="cond">#equ</span></a> - show complete equations and results (default);<br />
<a href="#0" data-text="#noc"><span class="cond">#noc</span></a> - show only equations without results (no calculations);<br />
<a href="#0" data-text="#nosub"><span class="cond">#nosub</span></a> - do not substitute variables (no substitution);<br />
<a href="#0" data-text="#novar"><span class="cond">#novar</span></a> - show equations only with substituted values (no variables);<br />
<a href="#0" data-text="#varsub"><span class="cond">#varsub</span></a> - show equations with variables and substituted values (default);<br />
<a href="#0" data-text="#split"><span class="cond">#split</span></a> - split equations that do not fit on a single line;<br />
<a href="#0" data-text="#wrap"><span class="cond">#wrap</span></a> - wrap equations that do not fit on a single line (default);<br />
<a href="#0" data-text="#round "><span class="cond">#round <em>n</em></span></a> - rounds the output to <em>n</em> digits after the decimal point.<br />
Each of the above commands is effective after the current line until the end of the report or another command that overwrites it.
</span>
<span id="list9" style="display: none;">
<a href="#0" data-text="#hide"><span class="cond">#hide</span></a> - hide the report contents;<br />
<a href="#0" data-text="#show"><span class="cond">#show</span></a> - always show the contents (default);<br />
<a href="#0" data-text="#pre"><span class="cond">#pre</span></a> - show the next contents only before calculations;<br />
<a href="#0" data-text="#post"><span class="cond">#post</span></a> - show the next contents only after calculations;<br />
<a href="#0" data-text="#val"><span class="cond">#val</span></a> - show only the final result, without the equation;<br />
<a href="#0" data-text="#equ"><span class="cond">#equ</span></a> - show complete equations and results (default);<br />
<a href="#0" data-text="#noc"><span class="cond">#noc</span></a> - show only equations without results (no calculations);<br />
<a href="#0" data-text="#nosub"><span class="cond">#nosub</span></a> - do not substitute variables (no substitution);<br />
<a href="#0" data-text="#novar"><span class="cond">#novar</span></a> - show equations only with substituted values (no variables);<br />
<a href="#0" data-text="#varsub"><span class="cond">#varsub</span></a> - show equations with variables and substituted values (default);<br />
<a href="#0" data-text="#split"><span class="cond">#split</span></a> - split equations that do not fit on a single line;<br />
<a href="#0" data-text="#wrap"><span class="cond">#wrap</span></a> - wrap equations that do not fit on a single line (default);<br />
<a href="#0" data-text="#round "><span class="cond">#round <em>n</em></span></a> - rounds the output to <em>n</em> digits after the decimal point.<br />
Each of the above commands is effective after the current line until the end of the report or another command that overwrites it.
</span>
</li>
<li style="list-style-type: none;">
<span class="exp" id="btn10">+</span>Breakpoints for step-by-step execution:<br />
Expand Down
Binary file modified Setup/calcpad-setup-en-x64.exe
Binary file not shown.
Binary file modified Setup/calcpad-setup-en-x64.zip
Binary file not shown.

0 comments on commit c6cd044

Please sign in to comment.