fix: prevent crash by ensuring there is active section on app start
If `activeSectionId` does point to section that is not restored correctly (by any reason), then the app will crash. That's becasue code assumes there is always an active section set and it will try to reference null item in this case. fixes: #8785
This commit is contained in:
parent
8a749846df
commit
c9b1082795
|
@ -472,7 +472,7 @@ method load*[T](
|
|||
|
||||
# Set active section on app start
|
||||
# If section is profile then open chat by default
|
||||
if activeSection.sectionType == SectionType.ProfileSettings:
|
||||
if activeSection.isEmpty() or activeSection.sectionType == SectionType.ProfileSettings:
|
||||
self.setActiveSection(self.view.model().getItemBySectionType(SectionType.Chat))
|
||||
else:
|
||||
self.setActiveSection(activeSection)
|
||||
|
|
Loading…
Reference in New Issue