     }
     
     public func willDisplay(saveButton: SaveButton, for article: WMFArticle, with userInfo: Any? = nil) {
-        guard let key = article.inMemoryKey else {
+        guard let key = article.inMemoryKey, let databaseKey = article.key else {
             return
         }
         let tag = key.hash

        saveButton.tag = tag
        saveButton.addTarget(self, action: #selector(saveButtonPressed(sender:)), for: .touchUpInside)
        saveButton.saveButtonDelegate = self
        var saveButtons = visibleSaveButtons[tag] ?? []
        saveButtons.insert(saveButton)
        visibleSaveButtons[tag] = saveButtons
        visibleArticleKeys[tag] = key
        visibleUserInfo[tag] = userInfo
    }
    
    public func didEndDisplaying(saveButton: SaveButton, for article: WMFArticle) {
        guard let key = article.inMemoryKey else {
            return
        }
        let tag = key.hash


class SaveButtonsController: NSObject, SaveButtonDelegate {
    
    // The tag refers to a specific article button, which takes the article database key and language variant into account
    // But we need to keep all save buttons for an article, across all variants, updated with the same value
    // visibleSaveButtonTagsByDatabaseKey maps from the database key - equal for all variants to a set of tags of all the buttons for that article
    // visibleSaveButtons maps the tag to the save button.
    var visibleSaveButtons = [Int: Set<SaveButton>]()
    var visibleSaveButtonTagsByDatabaseKey = [String: Set<Int>]()
    var visibleArticleKeys = [Int: WMFInMemoryURLKey]()
    var visibleUserInfo = [Int: Any]()
    
