Skip to content

Commit 01f0401

Browse files
committed
Merge pull request #4963 from wordpress-mobile/issue/3d-touch-crash
Issue/3d touch crash
2 parents f263100 + b6416c6 commit 01f0401

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

WordPress/Classes/System/3DTouch/WP3DTouchShortcutCreator.swift

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,11 @@ public class WP3DTouchShortcutCreator: NSObject
3232
}
3333

3434
if loggedIn {
35-
createLoggedInShortcuts()
35+
if hasBlog() {
36+
createLoggedInShortcuts()
37+
} else {
38+
clearShortcuts()
39+
}
3640
} else {
3741
createLoggedOutShortcuts()
3842
}
@@ -99,6 +103,10 @@ public class WP3DTouchShortcutCreator: NSObject
99103
application.shortcutItems = visibleShortcutArray
100104
}
101105

106+
private func clearShortcuts() {
107+
application.shortcutItems = nil
108+
}
109+
102110
private func createLoggedOutShortcuts() {
103111
application.shortcutItems = loggedOutShortcutArray()
104112
}
@@ -122,4 +130,8 @@ public class WP3DTouchShortcutCreator: NSObject
122130

123131
return hasWordPressComAccount() && currentBlog.supports(BlogFeature.Stats)
124132
}
133+
134+
private func hasBlog() -> Bool {
135+
return blogService.blogCountForAllAccounts() > 0
136+
}
125137
}

0 commit comments

Comments
 (0)