[newsfeed] Boobmsg crashes if id is None
This commit is contained in:
parent
8b20ba5f55
commit
a02d34827d
1 changed files with 4 additions and 2 deletions
|
|
@ -43,6 +43,8 @@ class Entry(object):
|
||||||
|
|
||||||
if "link" in entry:
|
if "link" in entry:
|
||||||
self.link = entry["link"]
|
self.link = entry["link"]
|
||||||
|
if not self.id:
|
||||||
|
self.id = entry["link"]
|
||||||
else:
|
else:
|
||||||
self.link = None
|
self.link = None
|
||||||
|
|
||||||
|
|
@ -94,6 +96,6 @@ class Newsfeed(object):
|
||||||
yield Entry(entry, self.rssid_func)
|
yield Entry(entry, self.rssid_func)
|
||||||
|
|
||||||
def get_entry(self, id):
|
def get_entry(self, id):
|
||||||
for entry in self.feed['entries']:
|
for entry in self.iter_entries():
|
||||||
if entry.id == id:
|
if entry.id == id:
|
||||||
return Entry(entry, self.rssid_func)
|
return entry
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue