mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-24 16:48:45 +05:00
Update empty xml_root_path sanity check case.
Also added tests for it. Added comment to the *HierarchyPath.AsString() function, addressing the issue of not being able to retrieve the element when the root path is equal to the path that is being processed.
This commit is contained in:
committed by
Dan Christian Bogos
parent
950c5279a6
commit
0bc94857ca
@@ -650,6 +650,12 @@ func (hP HierarchyPath) AsString(sep string, prefix bool) string {
|
||||
if prefix {
|
||||
strHP.WriteString(sep)
|
||||
}
|
||||
|
||||
// TODO: Since this function can convert both the full and the relative HierarchyPath to a string, with
|
||||
// prefix telling us which is which (true -> full path, false -> relative path), we should consider
|
||||
// returning the '.' character when prefix == false. Currently, because we are returning an empty string
|
||||
// if the path we are currently parsing is equal to the root path, when we attempt to retrieve the element
|
||||
// we receive the error "expr expression is nil".
|
||||
if len(hP) == 0 {
|
||||
return strHP.String()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user