Skip to content

Commit a543dcf

Browse files
committed
handle no world case
1 parent 56d96f7 commit a543dcf

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

packages/the-org/src/init.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,11 @@ export async function initializeAllSystems(
9292
const ownerId = createUniqueUuid(runtime, server.ownerId);
9393

9494
const existingWorld = await runtime.getWorld(worldId);
95-
if (existingWorld.metadata?.settings) {
95+
if (!existingWorld) {
96+
logger.debug('Onboarding not initialized for server', server.id);
97+
continue;
98+
}
99+
if (existingWorld?.metadata?.settings) {
96100
logger.debug('Onboarding already initialized for server', server.id);
97101
continue;
98102
}
@@ -115,7 +119,7 @@ export async function initializeAllSystems(
115119

116120
await runtime.ensureWorldExists(world);
117121
await initializeOnboarding(runtime, world, config);
118-
await startOnboardingDM(runtime, server, worldId);
122+
// await startOnboardingDM(runtime, server, worldId);
119123
}
120124
} catch (error) {
121125
logger.error('Error initializing systems:', error);

0 commit comments

Comments
 (0)