NewsDownloader: avoid some crashes (#9697)

Keep nil reference from being passed to UIManager.
reviewable/pr9763/r1
Roygbyte 1 year ago committed by GitHub
parent a1256f6758
commit eb1e084d93
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -678,7 +678,7 @@ function NewsDownloader:viewFeedList()
}
)
-- Show the list of feeds.
if #self.kv ~= 0 then
if self.kv then
UIManager:close(self.kv)
end
self.kv = KeyValuePage:new{
@ -693,7 +693,7 @@ function NewsDownloader:viewFeedList()
end
function NewsDownloader:viewFeedItem(data)
if #self.kv ~= 0 then
if self.kv then
UIManager:close(self.kv)
end
self.kv = KeyValuePage:new{
@ -802,7 +802,7 @@ function NewsDownloader:updateFeedConfig(id, key, value)
-- Because this method is called at the menu,
-- we might not have an active view. So this conditional
-- statement avoids closing a null reference.
if #self.kv ~= 0 then
if self.kv then
UIManager:close(self.kv)
end
-- It's possible that we will get a null value.

Loading…
Cancel
Save