mirror of
https://github.com/sysadminsmedia/homebox.git
synced 2025-12-21 13:23:14 +01:00
Fix nil pointer dereference panic in thumbnail subscription during shutdown (#892)
* Initial plan * Fix nil pointer dereference in thumbnail subscription handling Add nil check for msg after subscription.Receive() returns error to prevent panic when accessing msg.Metadata. When an error occurs or msg is nil, continue to next iteration instead of trying to process the message. Co-authored-by: tankerkiller125 <3457368+tankerkiller125@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: tankerkiller125 <3457368+tankerkiller125@users.noreply.github.com>
This commit is contained in:
@@ -369,6 +369,11 @@ func run(cfg *config.Config) error {
|
||||
log.Debug().Msg("received thumbnail generation request from pubsub topic")
|
||||
if err != nil {
|
||||
log.Err(err).Msg("failed to receive message from pubsub topic")
|
||||
continue
|
||||
}
|
||||
if msg == nil {
|
||||
log.Warn().Msg("received nil message from pubsub topic")
|
||||
continue
|
||||
}
|
||||
groupId, err := uuid.Parse(msg.Metadata["group_id"])
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user