Bug fix: handle the case where a container has only default elements
This commit is contained in:
committed by
AMZN-koppersr
parent
76e0f84670
commit
3c46a72672
@@ -102,6 +102,17 @@ namespace AZ
|
||||
return context.Report(retVal, "Processing of basic container was halted.");
|
||||
}
|
||||
|
||||
// If each container element was 'DefaultsUsed', then the result code will be 'DefaultsUsed'
|
||||
// But this is wrong if the container has at least one element, because a container with
|
||||
// at least one element is certainly not the default container value.
|
||||
// Basically, the following are different objects:
|
||||
// [ {} ] // The container which has only default elements, but is not the empty container
|
||||
// {} // The default container, which is empty
|
||||
if (index > 0)
|
||||
{
|
||||
retVal.Combine(JSR::ResultCode(JSR::Tasks::WriteValue, JSR::Outcomes::Success));
|
||||
}
|
||||
|
||||
if (context.ShouldKeepDefaults())
|
||||
{
|
||||
outputValue = AZStd::move(array);
|
||||
|
||||
Reference in New Issue
Block a user