We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 12beab4 commit e910860Copy full SHA for e910860
1 file changed
src/mono/mono/metadata/custom-attrs.c
@@ -397,7 +397,11 @@ MONO_RESTORE_WARNING
397
// to decode some attributes in assemblies that Windows .NET Framework
398
// and CoreCLR both manage to decode.
399
// See https://simonsapin.github.io/wtf-8/ for a description of wtf-8.
400
- *out_obj = (MonoObject*)mono_string_new_wtf8_len_checked (p, slen, error);
+ // Always use string.Empty for empty strings
401
+ if (slen == 0)
402
+ *out_obj = (MonoObject*)mono_string_empty_internal (mono_domain_get ());
403
+ else
404
+ *out_obj = (MonoObject*)mono_string_new_wtf8_len_checked (p, slen, error);
405
return NULL;
406
}
407
case MONO_TYPE_CLASS: {
0 commit comments