Skip to content

Commit

Permalink
Fix 1.2.19 version nil pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
vit1251 committed Jul 9, 2022
1 parent 3e8ec1a commit 872dae3
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 14 deletions.
4 changes: 2 additions & 2 deletions Application.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,14 @@ func (self *Application) Run() {
self.registry.Register(queue.QUEUE_MANAGER_ID, queue.NewQueueManager(self.registry))
self.registry.Register("EventBus", eventbus.NewEventBus(self.registry))
self.registry.Register("StorageManager", storage.NewStorageManager(self.registry))
self.registry.Register("MapperManager", mapper.NewMapperManager(self.registry))
self.registry.Register(mapper.MAPPER_MANAGER_ID, mapper.NewMapperManager(self.registry))
self.registry.Register(config.CONFIG_MANAGER_ID, config.NewConfigManager(self.registry))

self.registry.Register(installer.MIGRATION_MANAGER_ID, installer.NewMigrationManager(self.registry))

self.registry.Register(charset.CHARSET_MANAGER_ID, charset.NewCharsetManager(self.registry))

self.registry.Register("TrackerManager", tracker.NewTrackerManager(self.registry))
self.registry.Register(tracker.TRACKER_MANAGER_ID, tracker.NewTrackerManager(self.registry))
self.registry.Register("TosserManager", tosser.NewTosserManager(self.registry))
self.registry.Register("MailerManager", mailer.NewMailerManager(self.registry))

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ require (
go.uber.org/atomic v1.9.0 // indirect
go.uber.org/multierr v1.8.0 // indirect
go.uber.org/zap v1.21.0 // indirect
golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e // indirect
golang.org/x/sys v0.0.0-20220708085239-5a0f0661e09d // indirect
golang.org/x/text v0.3.7
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
)
12 changes: 4 additions & 8 deletions pkg/tosser/TosserManager.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,14 @@ import (
)

type TosserManager struct {
event chan bool
registry *registry.Container
}

func (self *TosserManager) GetRegistry() *registry.Container {
return self.registry
registry.Service
event chan bool
}

func NewTosserManager(registry *registry.Container) *TosserManager {

tm := new(TosserManager)
tm.registry = registry
tm.SetRegistry(registry)

tm.event = make(chan bool)

Expand All @@ -62,7 +58,7 @@ func (self *TosserManager) Start() {
}

func (self *TosserManager) processTosser() {
newTosser := NewTosser(self.registry)
newTosser := NewTosser(self.GetRegistry())
newTosser.Toss()
}

Expand Down
5 changes: 2 additions & 3 deletions pkg/tracker/Tracker.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import (

type Tracker struct {
registry.Service
registry *registry.Container
}

func NewTracker(r *registry.Container) *Tracker {
Expand Down Expand Up @@ -78,13 +77,13 @@ func (self *Tracker) ProcessOutbound() error {

func (self *Tracker) processTICmail(item queue.FileEntry) error {

mapperManager := mapper.RestoreMapperManager(self.registry)
mapperManager := mapper.RestoreMapperManager(self.GetRegistry())
fileMapper := mapperManager.GetFileMapper()
fileAreaMapper := mapperManager.GetFileAreaMapper()
//TODO - statMapper := mapperManager.GetStatMapper()

/* Parse */
newTicParser := NewTicParser(self.registry)
newTicParser := NewTicParser(self.GetRegistry())
tic, err1 := newTicParser.ParseFile(item.AbsolutePath)
if err1 != nil {
return err1
Expand Down

0 comments on commit 872dae3

Please sign in to comment.