mirror of
https://github.com/CommunitySolidServer/CommunitySolidServer.git
synced 2024-10-03 14:55:10 +00:00
fix: Prevent setRepresentation crash if there is no root container
This commit is contained in:
@@ -385,7 +385,9 @@ export class DataAccessorBasedStore implements ResourceStore {
|
||||
} catch (error: unknown) {
|
||||
if (NotFoundHttpError.isInstance(error)) {
|
||||
// Make sure the parent exists first
|
||||
await this.createRecursiveContainers(this.identifierStrategy.getParentContainer(container));
|
||||
if (!this.identifierStrategy.isRootContainer(container)) {
|
||||
await this.createRecursiveContainers(this.identifierStrategy.getParentContainer(container));
|
||||
}
|
||||
await this.writeData(container, new BasicRepresentation([], container), true);
|
||||
} else {
|
||||
throw error;
|
||||
|
||||
Reference in New Issue
Block a user