Sparkle calls -[NSString boolValue] on 10.4

Bug #439684 reported by cmh
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Sparkle
New
Undecided
Unassigned
Nominated for 1.5 by cmh

Bug Description

Sparkle's documentation suggests setting Info.plist values to the string 'YES', however it then calls boolValue on them. This breaks applications on 10.4, which does not support -boolValue for strings.

One of the three following steps should be done:

1. Alter the documentation to ensure the developer right-clicks the row in Info.plist and selects Value Type -> Boolean, or

2. Alter the code to check the type of values on 10.4 to ensure they are not strings before calling boolValue, substituting case-insensitive string checks for ('yes' or '1') or ('no' or '0')

3. Somewhere suggest that the framework will not work on 10.4 as documented.

Revision history for this message
cmh (5-launchpad-cmh-parliant-com) wrote :

Forgot Sparkle version: 1.5b6

Revision history for this message
Andy Matuschak (andymatuschak) wrote :

This one's been fixed since 1.5b6.

Changed in sparkle:
status: New → Fix Committed
Revision history for this message
Alex B (alex-belonosov) wrote :

Andy, I'm using version 1.5b6 and the problem is still there. [NSString boolValue] is called when an Updater object is created in NIB. The NIB fails to load on 10.4 printing the error about [NSString boolValue] on terminal. (I have run the app in Terminal to see debug output).

Changed in sparkle:
status: Fix Committed → New
Revision history for this message
Hofman (cmhofman) wrote :

There shouldn't be a string in the prefs for the boolean keys Sparkle uses. Did you hand-edit your preference file, or did you use a string in your Info.plist file instead of <false/> or <true/>?

Revision history for this message
Hofman (cmhofman) wrote :

Only for the LSUIElement key the value is in fact a string, that's definitely a bug. Otherwise, when it's a string, you're using the wrong type of value.

Revision history for this message
Hofman (cmhofman) wrote :

Sorry, I was wrong on that one, it's not checking the Info.plist value directly, so LSUIElement is handled correctly.

So the only way I can see such a problem to occur with 1.5b6 is when you're using a string in Info.plist for one of the boolean Sparkle keys, which you simply should never do when you want to support 10.4.

Revision history for this message
cmh (5-launchpad-cmh-parliant-com) wrote :

Hofman, have you tested this pronouncement on 10.4? My testing on 10.4.11 shows that all values in Info.plist files are returned as NSString objects, even if they contain all digits.

For safety, the code should check the object returned is not a string before calling boolValue, if Sparkle wishes to support 10.4.

Revision history for this message
cmh (5-launchpad-cmh-parliant-com) wrote :

Oops, sorry Hofman, I got confused by the many comments. I now see you mean ensuring that the Info.plist entries are of Boolean type, not simply placing a non-string value in the entry. I agree, doing this fixes the problem on 10.4.

However, this now becomes a documentation bug, as the Sparkle install instructions suggest supplying the string 'YES' for these values. I will alter the bug accordingly.

description: updated
description: updated
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.