Skip to content

Commit 5f2eed6

Browse files
Merge pull request livecode#1502 from runrevsebastien/bugfix-14052
[[ Bug 14052 ]] Ensure no nil string is returned for the type in queryRe...
2 parents 36f5f1d + 24ae319 commit 5f2eed6

3 files changed

Lines changed: 5 additions & 0 deletions

File tree

docs/notes/bugfix-14052.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# LiveCode 7 crashes without error in many commands

engine/src/dskw32.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,8 @@ bool MCS_registry_type_to_string(uint32_t p_type, MCStringRef& r_string)
382382
}
383383
}
384384

385+
// SN-2014-11-18: [[ Bug 14052 ]] Avoid to return a nil string (the result is not checked anyway).
386+
r_string = MCValueRetain(kMCEmptyString);
385387
return false;
386388
}
387389

engine/src/exec-files.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,8 @@ void MCFilesEvalQueryRegistryWithType(MCExecContext& ctxt, MCStringRef p_key, MC
455455
{
456456
ctxt.SetTheResultToValue(*t_error);
457457
r_string = MCValueRetain(kMCEmptyString);
458+
// SN-2014-11-18: [[ Bug 14052 ]] Assign the empty string to the type as well.
459+
r_type = MCValueRetain(kMCEmptyString);
458460
}
459461
else
460462
ctxt.SetTheResultToEmpty();

0 commit comments

Comments
 (0)