From 40d35f4cfb1ba3124af5f2ce270db9f4c7b59cd4 Mon Sep 17 00:00:00 2001 From: Anton Tarasenko Date: Tue, 4 Oct 2022 03:45:21 +0700 Subject: [PATCH] Fix `ResolveCustomSource()` not always copying argument on failure --- sources/Aliases/AliasesAPI.uc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sources/Aliases/AliasesAPI.uc b/sources/Aliases/AliasesAPI.uc index bb62091..fc684d8 100644 --- a/sources/Aliases/AliasesAPI.uc +++ b/sources/Aliases/AliasesAPI.uc @@ -349,7 +349,11 @@ public final function Text ResolveCustom( local BaseAliasSource customSource; customSource = GetCustomSource(sourceName); - if (customSource == none) { + if (customSource == none) + { + if (copyOnFailure && alias != none) { + return alias.Copy(); + } return none; } return ResolveWithSource(alias, customSource, copyOnFailure);