mirror of
https://github.com/sipeed/picoclaw.git
synced 2026-06-12 18:08:54 +00:00
Merge pull request #3022 from chengzhichao-xydt/codex/sync-map-assertions
fix: add ok checks for sync.Map LoadAndDelete/Load type assertions
This commit is contained in:
@@ -746,8 +746,8 @@ func (c *FeishuChannel) isBotMentioned(message *larkim.EventMessage) bool {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
knownID, _ := c.botOpenID.Load().(string)
|
knownID, ok := c.botOpenID.Load().(string)
|
||||||
if knownID == "" {
|
if !ok || knownID == "" {
|
||||||
logger.DebugCF("feishu", "Bot open_id unknown, cannot detect @mention", nil)
|
logger.DebugCF("feishu", "Bot open_id unknown, cannot detect @mention", nil)
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -154,7 +154,10 @@ func (c *SlackChannel) Send(ctx context.Context, msg bus.OutboundMessage) ([]str
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ref, ok := c.pendingAcks.LoadAndDelete(deliveryChatID); ok {
|
if ref, ok := c.pendingAcks.LoadAndDelete(deliveryChatID); ok {
|
||||||
msgRef := ref.(slackMessageRef)
|
msgRef, ok := ref.(slackMessageRef)
|
||||||
|
if !ok {
|
||||||
|
return []string{ts}, nil
|
||||||
|
}
|
||||||
c.api.AddReaction("white_check_mark", slack.ItemRef{
|
c.api.AddReaction("white_check_mark", slack.ItemRef{
|
||||||
Channel: msgRef.ChannelID,
|
Channel: msgRef.ChannelID,
|
||||||
Timestamp: msgRef.Timestamp,
|
Timestamp: msgRef.Timestamp,
|
||||||
|
|||||||
@@ -62,7 +62,10 @@ func postStartPlatformIsolation(cmd *exec.Cmd, isolation config.IsolationConfig,
|
|||||||
if !isolation.Enabled || cmd == nil || cmd.Process == nil {
|
if !isolation.Enabled || cmd == nil || cmd.Process == nil {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
resourcesAny, _ := windowsPendingResources.LoadAndDelete(cmd)
|
resourcesAny, loaded := windowsPendingResources.LoadAndDelete(cmd)
|
||||||
|
if !loaded {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
resources, _ := resourcesAny.(windowsProcessResources)
|
resources, _ := resourcesAny.(windowsProcessResources)
|
||||||
// Job objects can only be attached after the process exists, so the Windows
|
// Job objects can only be attached after the process exists, so the Windows
|
||||||
// backend finishes isolation in this post-start hook.
|
// backend finishes isolation in this post-start hook.
|
||||||
|
|||||||
Reference in New Issue
Block a user