diff --git a/whapp-handler.go b/whapp-handler.go index 1c6be28..90d4167 100644 --- a/whapp-handler.go +++ b/whapp-handler.go @@ -13,6 +13,11 @@ type WhappHandler struct { } func (h *WhappHandler) HandleError(err error) { + // Apparently, the error passed to this function can sometimes be nil. + if err == nil { + return + } + if _, connectionFailed := err.(*whatsapp.ErrConnectionFailed); connectionFailed { err = RestoreWhappSessionFromStorage( h.BridgeContext.Config.App.DataFolder,