refactor(adminui): harden SetFullName (reject blank ref) + cover alarm-flag re-pick
Code-review nits: SetFullName now throws on a blank reference (was silently persisting FullName:null → silent deploy-time bind failure), and a new test covers the alarm-typed re-pick combo (SeedDefaultAlarm over an already-edited alarm leaves it intact).
This commit is contained in:
@@ -54,6 +54,9 @@ public static class TagConfigJson
|
||||
/// </summary>
|
||||
public static string SetFullName(string? json, string fullName)
|
||||
{
|
||||
// A blank reference is never a valid Galaxy bind — surface it loudly rather than persisting
|
||||
// a poisoned "FullName": null/"" that would silently fail to bind at deploy time.
|
||||
ArgumentException.ThrowIfNullOrWhiteSpace(fullName);
|
||||
var o = ParseOrNew(json);
|
||||
o["FullName"] = JsonValue.Create(fullName);
|
||||
return Serialize(o);
|
||||
|
||||
Reference in New Issue
Block a user