File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -169,16 +169,30 @@ export function createUser(address: Address): void {
169169}
170170
171171export function createLiquiditySnapshot ( position : LiquidityPosition , event : EthereumEvent ) : void {
172+ if ( User . load ( position . user ) === null ) {
173+ log . error (
174+ 'Null user during snapshot creation. User id: '
175+ . concat ( position . user )
176+ . concat ( ' position id: ' )
177+ . concat ( position . id )
178+ . concat ( ' tx hash: ' )
179+ . concat ( event . transaction . hash . toHexString ( ) )
180+ . concat ( ' --> SKIPPING SNAPSHOT CREATION' ) ,
181+ [ ]
182+ )
183+ return
184+ }
185+
172186 let bundle = Bundle . load ( '1' )
173187 let pair = Pair . load ( position . pair )
174188 let token0 = Token . load ( pair . token0 )
175189 let token1 = Token . load ( pair . token1 )
176190
177191 // create new snapshot
178192 let id = position . id
179- . concat ( "-" )
193+ . concat ( '-' )
180194 . concat ( event . transaction . hash . toHexString ( ) )
181- . concat ( "-" )
195+ . concat ( '-' )
182196 . concat ( event . logIndex . toString ( ) )
183197 let snapshot = new LiquidityPositionSnapshot ( id )
184198 snapshot . liquidityPosition = position . id
You can’t perform that action at this time.
0 commit comments