We are seeing a repeating error from the Salesforce Slack app whenever a user posts a message in Slack. The message in the channel is delivered normally, but the author also gets an ephemeral error in the Salesforce app DM.
Error (Only visible to you):
There was a problem processing the Slack event MESSAGE_EVENT ErrorType: NullPointerException
This happens on every message typed directly in Slack.
Please advise how to stop the Salesforce app from sending these errors (configuration, scopes/event subscription, or a known platform issue). If the user sends a message from Salesforce, this error does not occur and everything works correctly;
Hey Maksimilian,
That error is the Apex SDK for Slack telling you your message-event handler threw an unhandled exception — it's coming from your Apex code, not Slack itself. That's also why it only happens on inbound Slack messages: sending from Salesforce never touches that handler, so nothing throws.
Turn on debug logs for the integration user and post one test message — the log will show the exact line that's null.
Usual causes:
- Message subtypes (bot messages, edits, thread replies, channel_join) hit the same handler but don't carry the same fields, so event.getUser()/getText() comes back null if you assume every message looks the same.
- A SOQL lookup by user/channel ID returning no rows, then grabbing [0] before checking.
Fix is null-guarding the handler itself — no need to touch scopes or event subscriptions. Happy to look at the handler class if you want to share it.