Skip to content

Commit

Permalink
Hotfix for default name crash
Browse files Browse the repository at this point in the history
  • Loading branch information
juanmardefago committed Dec 27, 2021
1 parent d845def commit 2f2e6e9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/mappings/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -650,10 +650,13 @@ function createGraphAccountName(
// check that this name is not already used by another graph account (changing ownership)
// If so, remove the old owner, and set the new one
} else if (graphAccountName.graphAccount != graphAccount) {
// Set defaultDisplayName to null if they lost ownership of this name
let oldGraphAccount = GraphAccount.load(graphAccountName.graphAccount!)!
oldGraphAccount.defaultDisplayName = null
oldGraphAccount.save()
// Only update the old graph account if it exists
if (graphAccountName.graphAccount != null) {
// Set defaultDisplayName to null if they lost ownership of this name
let oldGraphAccount = GraphAccount.load(graphAccountName.graphAccount!)!
oldGraphAccount.defaultDisplayName = null
oldGraphAccount.save()
}

graphAccountName.graphAccount = graphAccount
graphAccountName.save()
Expand Down
3 changes: 3 additions & 0 deletions subgraph.template.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
specVersion: 0.0.2
description: The Graph Network Smart Contracts on Ethereum
repository: https://github.com/graphprotocol/contracts/graph-network-subgraph
graft:
base: QmVCEVXN4SSeKQfgpQoc6j4APYM4xg5ssfcEJVGoQkd26K
block: 13887937
schema:
file: ./schema.graphql
dataSources:
Expand Down

0 comments on commit 2f2e6e9

Please sign in to comment.