Skip to content

Commit 9439ee2

Browse files
committed
修正 SideMenu 下载头像出错误的数据时,会 Crash 的问题;
1 parent 6b33250 commit 9439ee2

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

ruby-china-ios/Controllers/SideMenuViewController.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,9 @@ class SideMenuViewController: UITableViewController {
154154
return
155155
}
156156
if let data = data {
157-
onComplate(avatar: UIImage(data: data)!)
157+
if let avatar = UIImage(data: data) {
158+
onComplate(avatar: avatar)
159+
}
158160
}
159161
}
160162
downloadTask.resume()
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>aps-environment</key>
6+
<string>development</string>
7+
</dict>
8+
</plist>

0 commit comments

Comments
 (0)