Merge ~timur-adamow/wicd:fix-1184629 into wicd:master

Proposed by Timur
Status: Needs review
Proposed branch: ~timur-adamow/wicd:fix-1184629
Merge into: wicd:master
Diff against target: 19 lines (+3/-5)
1 file modified
curses/netentry_curses.py (+3/-5)
Reviewer Review Type Date Requested Status
Wicd-devel Pending
Review via email: mp+373785@code.launchpad.net

Commit message

Description of the change

Due to the bug #1184629, wicd-curses could crash after trying to find the index of the current bitrate and use it in a bitrate combobox. With this fix, wicd-curses will not attempt to select current bitrate if there is no current bitrate.

To post a comment you must log in.

Unmerged commits

03d25af... by Timur Adamov <email address hidden>

Fix bug #1184629

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/curses/netentry_curses.py b/curses/netentry_curses.py
2index 1803a16..b849afe 100644
3--- a/curses/netentry_curses.py
4+++ b/curses/netentry_curses.py
5@@ -538,11 +538,9 @@ class WirelessSettingsDialog(AdvancedSettingsDialog):
6 self.bitrates = wireless.GetAvailableBitrates()
7 self.bitrates.append('auto')
8 self.bitrate_combo.set_list(self.bitrates)
9- self.bitrate_combo.set_focus(
10- self.bitrates.index(
11- wireless.GetWirelessProperty(networkID, 'bitrate')
12- )
13- )
14+ network_bitrate = wireless.GetWirelessProperty(networkID, 'bitrate')
15+ if (network_bitrate is not None):
16+ self.bitrate_combo.set_focus(self.bitrates.index(network_bitrate))
17 self.allow_lower_bitrates_chkbox.set_state(
18 to_bool(self.format_entry(networkID, 'allow_lower_bitrates'))
19 )

Subscribers

People subscribed via source and target branches

to all changes: