ortuman/jackal

Panics when using PEP

SamWhited opened this issue ยท 2 comments

When using PEP, right after fetching bookmarks, I see the following panic in the logs:

๐Ÿ’ฅ [ERR] runqueue/runqueue:117 - runqueue 'xep0163' panicked with error: runtime error: invalid memory address or nil pointer dereference
goroutine 196 [running]:                                                                                                                                                                           github.com/ortuman/jackal/util/runqueue.(*RunQueue).logStackTrace(0xc000090780, 0x9fade0, 0xf9e3f0)
        /home/sam/jackal/util/runqueue/runqueue.go:115 +0x6d                                                                                                                                       github.com/ortuman/jackal/util/runqueue.(*RunQueue).run.func1(0xc000090780)
        /home/sam/jackal/util/runqueue/runqueue.go:93 +0x4b                                      
panic(0x9fade0, 0xf9e3f0)                                                                        
        /home/sam/gotip/src/runtime/panic.go:967 +0x15d                                          
github.com/ortuman/jackal/storage/pgsql.(*pgSQLPubSub).FetchNode(0xc000010158, 0xb90ae0, 0xc000077860, 0xc0002162f0, 0xd, 0xc0002d2000, 0x18, 0x203000, 0xb95c60, 0xc000098018)                   
        /home/sam/jackal/storage/pgsql/pubsub.go:105 +0xf6                                       
github.com/ortuman/jackal/module/xep0163.(*Pep).withCommandContext(0xc00008e360, 0xb90ae0, 0xc000077860, 0x0, 0x0, 0x0, 0x1010100, 0xb991c0, 0xc000100fa0, 0xc0000777a0, ...)                     
        /home/sam/jackal/module/xep0163/pep.go:1030 +0x232                                       
github.com/ortuman/jackal/module/xep0163.(*Pep).processRequest(0xc00008e360, 0xb90ae0, 0xc000077860, 0xc0000777a0, 0xb991c0, 0xc000100f50)                                                        
        /home/sam/jackal/module/xep0163/pep.go:345 +0x303                                        
github.com/ortuman/jackal/module/xep0163.(*Pep).processIQ(0xc00008e360, 0xb90ae0, 0xc000077860, 0xc0000777a0)                                                                                     
        /home/sam/jackal/module/xep0163/pep.go:154 +0x171                                        
github.com/ortuman/jackal/module/xep0163.(*Pep).ProcessIQ.func1()   
        /home/sam/jackal/module/xep0163/pep.go:111 +0x45                                         
github.com/ortuman/jackal/util/runqueue.(*RunQueue).run(0xc000090780)
        /home/sam/jackal/util/runqueue/runqueue.go:100 +0x53
github.com/ortuman/jackal/util/runqueue.(*RunQueue).process(0xc000090780)
        /home/sam/jackal/util/runqueue/runqueue.go:75 +0x2b
created by github.com/ortuman/jackal/util/runqueue.(*RunQueue).schedule
        /home/sam/jackal/util/runqueue/runqueue.go:68 +0x5c

Thanks for reporting Sam! ๐Ÿ™‡

I'll take a deeper look ASAP. ๐Ÿ‘

Fixed @ #117