diff --git a/packages/commonwealth/server/routes/getNewProfile.ts b/packages/commonwealth/server/routes/getNewProfile.ts index e9d37851222..42c2cf1884e 100644 --- a/packages/commonwealth/server/routes/getNewProfile.ts +++ b/packages/commonwealth/server/routes/getNewProfile.ts @@ -44,16 +44,14 @@ const getNewProfile = async ( ) => { const { profileId } = req.query; + let profile: ProfileInstance; + if (profileId) { const parsedInt = parseInt(profileId); if (isNaN(parsedInt) || parsedInt !== parseFloat(profileId)) { throw new AppError('Invalid profile id'); } - } - let profile: ProfileInstance; - - if (profileId) { // @ts-expect-error StrictNullChecks profile = await models.Profile.findOne({ where: {