Skip to content

RelativePath.Parse should fail for invalid namespace index in browse path #954

@mediawolf

Description

@mediawolf

(checked on commit 2219e02)

I use this overload:
public static RelativePath Parse(string browsePath, ITypeTable typeTree, NamespaceTable currentTable, NamespaceTable targetTable)

browsePath = "2:SomeName"; <-- notice that namespace index is out of range for 'currentTable'
typeTree = session.TypeTree
currentTable = contains two namespaces: 0 - standard OPC UA namespace, 1 - custom namespace
targetTable= session.NamespaceUris which contains four namespaces: 0 - standard OPC UA namespace, 1 - some namespace #1, 2- custom namespace, 3 - some namespace #2

Resulting collection in RelativePath.Elements contains single entry "2:SomeName" which is correct though due to a pure coincidence. I expected a some kind of error to be reported by the method in such cases but, instead, it simply ignores invalid namespace index and keeps original name as is which potentially could point to a completely different node.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions