diff --git a/sim/dex-data.ts b/sim/dex-data.ts index 03d3cac862d59..fe79fd220b621 100644 --- a/sim/dex-data.ts +++ b/sim/dex-data.ts @@ -22,7 +22,7 @@ import {Utils} from '../lib'; export function toID(text: any): ID { if (typeof text !== 'string') { if (text) text = text.id || text.userid || text.roomid || text; - if (typeof text === 'number') text = '' + text; + if (typeof text === 'number') return '' + text; else if (typeof text !== 'string') return ''; } return text.toLowerCase().replace(/[^a-z0-9]+/g, '') as ID;