You can just do `if (msg === undefined)` here