Skip to content

Commit ca1551b

Browse files
mcpolo99RandomCrocodile
andauthored
fix(renamer): fix generic name parsing null case (upstream mkaring#516) (#33)
When preserveGenericParams is true but name is null or empty, ParseGenericName would crash. Add a null/empty guard to prevent this. Cherry-pick of mkaring#516. Co-authored-by: RandomCrocodile <mawi@polosab.com>
1 parent b596de6 commit ca1551b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Confuser.Renamer/NameService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ public string ObfuscateName(IDnlibDef dnlibDef, RenameMode mode) {
214214

215215
public string ObfuscateName(string format, string name, RenameMode mode, bool preserveGenericParams = false) {
216216
int genericParamsCount = 0;
217-
if (preserveGenericParams) {
217+
if (preserveGenericParams && !string.IsNullOrEmpty(name)) {
218218
name = ParseGenericName(name, out genericParamsCount);
219219
}
220220

0 commit comments

Comments
 (0)