Skip to content

Commit 12543cf

Browse files
author
Fraser J. Gordon
committed
Fix some incorrect checks against nil in Win32 deployment
1 parent 57484f1 commit 12543cf

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

engine/src/deploy_windows.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1658,7 +1658,7 @@ Exec_stat MCDeployToWindows(const MCDeployParameters& p_params)
16581658
if (t_success)
16591659
{
16601660
t_section_count = t_nt_header . FileHeader . NumberOfSections;
1661-
if (p_params . payload != nil)
1661+
if (!MCStringIsEmpty(p_params . payload))
16621662
t_payload_section = &t_section_headers[t_section_count - 3];
16631663
else
16641664
t_payload_section = nil;
@@ -1669,8 +1669,8 @@ Exec_stat MCDeployToWindows(const MCDeployParameters& p_params)
16691669
// Next we check that there are at least two sections, and they are the
16701670
// right ones.
16711671
if (t_success &&
1672-
(p_params . payload == nil && t_section_count < 2 ||
1673-
p_params . payload != nil && t_section_count < 3))
1672+
(MCStringIsEmpty(p_params . payload) && t_section_count < 2 ||
1673+
!MCStringIsEmpty(p_params . payload) && t_section_count < 3))
16741674
t_success = MCDeployThrow(kMCDeployErrorWindowsMissingSections);
16751675
if (t_success && memcmp(t_resource_section -> Name, ".rsrc", 6) != 0)
16761676
t_success = MCDeployThrow(kMCDeployErrorWindowsNoResourceSection);

0 commit comments

Comments
 (0)