Add check if the handler exists.

This commit is contained in:
Harm Aarts 2013-12-05 16:23:32 +01:00
parent b4a80d771a
commit 0aaac62e64
1 changed files with 2 additions and 2 deletions

View File

@ -181,12 +181,12 @@ func (this *Feed) notifyListeners() {
newitems = append(newitems, item)
}
}
if len(newitems) > 0 {
if len(newitems) > 0 && this.itemhandler != nil {
this.itemhandler(this, channel, newitems)
}
}
if len(newchannels) > 0 {
if len(newchannels) > 0 && this.chanhandler != nil {
this.chanhandler(this, newchannels)
}
}