After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 666614 - Exception was: TypeError: one is undefined
Exception was: TypeError: one is undefined
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: network-indicator
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2011-12-20 19:38 UTC by Jasper St. Pierre (not reading bugmail)
Modified: 2011-12-20 21:44 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Util: fix binary search exit condition (1.84 KB, patch)
2011-12-20 20:33 UTC, Giovanni Campagna
committed Details | Review

Description Jasper St. Pierre (not reading bugmail) 2011-12-20 19:38:29 UTC
This appears in my log:

    JS ERROR: !!!   Exception was: TypeError: one is undefined
    JS ERROR: !!!     lineNumber = '1147'
    JS ERROR: !!!     fileName = '"/home/jstpierre/Source/gnome3/source/gnome-shell/js/ui/status/network.js"'
    JS ERROR: !!!     stack = '"((void 0),[object Object])@/home/jstpierre/Source/gnome3/source/gnome-shell/js/ui/status/network.js:1147
wrapper((void 0),[object Object])@/home/jstpierre/Source/gnome3/install/share/gjs-1.0/lang.js:169
lowerBound([object Array],[object Object],wrapper)@/home/jstpierre/Source/gnome3/source/gnome-shell/js/misc/util.js:268
insertSorted([object Array],[object Object],wrapper)@/home/jstpierre/Source/gnome3/source/gnome-shell/js/misc/util.js:280
([object _private_NMClient_DeviceWifi],[object _private_NMClient_AccessPoint])@/home/jstpierre/Source/gnome3/source/gnome-shell/js/ui/status/network.js:1254
wrapper([object _private_NMClient_DeviceWifi],[object _private_NMClient_AccessPoint])@/home/jstpierre/Source/gnome3/install/share/gjs-1.0/lang.js:169
"'
    JS ERROR: !!!     message = '"one is undefined"'
Comment 1 Giovanni Campagna 2011-12-20 20:33:07 UTC
Created attachment 203983 [details] [review]
Util: fix binary search exit condition

The loop can exit with an interval of length one or one of
length zero. In the first case it is correct to check which side
of the interval to return, in the second case no comparison should
be made (since there is only one possible value).
In practice, this usually results in one comparison more than needed,
but in some cases (when the position was past the end of the array),
would call the comparator with undefined.
Comment 2 Jasper St. Pierre (not reading bugmail) 2011-12-20 21:26:42 UTC
Review of attachment 203983 [details] [review]:

The funny thing is that I was going to ask for a test for this but said "screw it, just commit now". I guess I should trust my gut more.
Comment 3 Giovanni Campagna 2011-12-20 21:44:22 UTC
Attachment 203983 [details] pushed as bbdce15 - Util: fix binary search exit condition