Skip to content

Commit

Permalink
fix(Provider): handle getDirectory on empty node correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
mint-dewit committed Sep 11, 2024
1 parent cb375cc commit 8abda16
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Ember/Server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
MatrixImpl,
Matrix,
Connections,
EmberNodeImpl,
} from '../../model'
import {
Collection,
Expand Down Expand Up @@ -367,6 +368,10 @@ export class EmberServer extends EventEmitter<EmberServerEvents> {
qualified.children[i as unknown as number] = new NumberedTreeNodeImpl(child.number, child.contents)
}
}
} else if (qualified.contents.type === ElementType.Node && !('children' in tree && tree.children)) {
// node without children -> none of the properties should be set
qualified.contents = new EmberNodeImpl()
qualified.children = undefined
}
const data = berEncode([qualified as RootElement], RootType.Elements)
client.sendBER(data)
Expand Down

0 comments on commit 8abda16

Please sign in to comment.