News Events, interesting things & other stuff

Check Out My Software

Take a look at my current selection of Mac software: ImageReel for browsing your pictures and the Google Maps plugin for your Address Book!

News Archives

News Feeds

RSS 2

June 16, 2005

Google Maps Plugin Bug Has Been Tracked Down

I was finally able to track down a bug that causes the Google Maps Plugin to not open the web browser. In the cases that I investigated, the cause was always an AppleScript Address Book plugin. The compatibility problem has been fixed for the next update.

For other developers, here’s where the problem was coming from:

When there are no AppleScript plugins installed for Address Book and the Google Map Plugin tried to retrieve the values for the different address fields, if a particular field was empty the return value from the person’s properties dictionary would be nil. This follows the normal return value for NSDictionary when a value doesn’t exist.

However, when an AppleScript is installed in the Plug-Ins folder, and when that AppleScript is valid for the same address that the Google Maps Plugin is, things change. Instead of returning nil if a field doesn’t exist, an instance of NSNull is returned. When this happens, all of the occurrences of if (someField != nil) pass, causing problems.

I’m not sure why this is the case, but it seems wrong to me to change return values only when there’s an AppleScript involved. And of course, I couldn’t find any mention of it in the documentation.

Obviously, now I check for both. If anyone has any insite as to why this might be, feel free to contact me about it.