zhuorantan / LocationPicker

A ready for use and fully customizable location picker for your app
MIT License
400 stars 79 forks source link

[LocationItem] Fatal Crash in Release Build #34

Closed bennnjamin closed 6 years ago

bennnjamin commented 6 years ago

LocationItem initialization seems to crash on iOS 11, perhaps when location or internet is disabled. Here's a stacktrace

0 LocationPickerViewController _hidden#211 line 141specialized LocationItem.init(coder : NSCoder) -> LocationItem
1 LocationPickerViewController _hidden#211 line 0hidden#165
2 Foundation _decodeObjectBinary + 1720
4 Foundation +[NSKeyedUnarchiver unarchiveObjectWithData:] + 88
5 interview _hidden#5816 line 22hidden#5770
6 interview _hidden#5816 line 0hidden#5742
7 LocationPickerViewController _hidden#71 line 340specialized LocationPicker.tableView(UITableView, numberOfRowsInSection : Int) -> Int
8 LocationPickerViewController _hidden#71 line 0hidden#432
9 UIKit -[UITableView _numberOfRowsInSection:] + 68
40 UIKit UIApplicationMain + 236

Line 141 of LocationItem is this one:

let addressDictionary = aDecoder.decodeObject(forKey: "addressDictionary") as! [String: AnyObject]

I suspect a force downcast would cause the crash but I am not sure what would cause this.

zhuorantan commented 6 years ago

Fixed via https://github.com/JeromeTan1997/LocationPicker/commit/af32560131ba6c4f9d7b11dd11f7e3926f894d4f