Fix: don't expect dump to contain client

Fixes: #2200
Fixes Bug introduced in: #2058
This commit is contained in:
Bernd Storath
2025-10-08 13:43:07 +02:00
parent cbbf5d3d25
commit 529d65b3fb

View File

@@ -19,17 +19,12 @@ export default definePermissionEventHandler(
});
}
// data can be undefined if the client is disabled
const data = await WireGuard.dumpByPublicKey(result.publicKey);
if (!data) {
throw createError({
statusCode: 500,
statusMessage: 'Failed to dump client data',
});
}
return {
...result,
endpoint: data.endpoint,
endpoint: data?.endpoint,
};
}
);