Commit 7aa9b7a
committed
Fix brightness restore crash
On systems with no brightness control, such as an XO-1 with kernel
4.6-rc1 due to 82ef33af9dd30075adbd9f3dd161b606b8ba88ac, Sugar does
crash on start with this shell.log fragment;
Traceback (most recent call last):
File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/usr/lib/python2.7/site-packages/jarabe/main.py", line 428, in <module>
main()
File "/usr/lib/python2.7/site-packages/jarabe/main.py", line 410, in main
brightness.get_instance()
File "/usr/lib/python2.7/site-packages/jarabe/model/brightness.py", line 30, in get_instance
_instance = Brightness()
File "/usr/lib/python2.7/site-packages/jarabe/model/brightness.py", line 53, in __init__
self._restore()
File "/usr/lib/python2.7/site-packages/jarabe/model/brightness.py", line 67, in _restore
self.set_brightness(value)
File "/usr/lib/python2.7/site-packages/jarabe/model/brightness.py", line 108, in set_brightness
self._monitor.handler_block(self._monitor_changed_hid)
AttributeError: 'NoneType' object has no attribute 'handler_block'
Fix is to avoid dereferencing _monitor if it is None.1 parent b0b8a04 commit 7aa9b7a
1 file changed
+8
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
107 | | - | |
108 | | - | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
109 | 110 | | |
110 | 111 | | |
111 | 112 | | |
112 | 113 | | |
113 | 114 | | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
118 | 120 | | |
119 | 121 | | |
120 | 122 | | |
| |||
0 commit comments