[message-listener] reformat apple-specific code and eliminate coverity w...

...arning

eliminate coverity warning

    Explicit null dereferenced