Commit 0bb25f37 authored by Dan Pascu's avatar Dan Pascu

Removed unnecessary try/except

parent b3df8245
...@@ -514,14 +514,10 @@ class SessionModel(QAbstractListModel): ...@@ -514,14 +514,10 @@ class SessionModel(QAbstractListModel):
selection_model.select(self.index(self.sessions.index(sibling)), selection_model.ClearAndSelect) selection_model.select(self.index(self.sessions.index(sibling)), selection_model.ClearAndSelect)
session_list.scrollToBottom() session_list.scrollToBottom()
else: else:
try: selected_index = selection_model.selectedIndexes()[0]
selected_index = selection_model.selectedIndexes()[0] if self.sessions[selected_index.row()] is source:
except IndexError: sibling = (session for session in source.conference.sessions if session is not source).next()
pass selection_model.select(self.index(self.sessions.index(sibling)), selection_model.ClearAndSelect)
else:
if self.sessions[selected_index.row()] is source:
sibling = (session for session in source.conference.sessions if session is not source).next()
selection_model.select(self.index(self.sessions.index(sibling)), selection_model.ClearAndSelect)
source.conference = None source.conference = None
self._remove_session(source) self._remove_session(source)
self._add_session(source) self._add_session(source)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment