fix: avoid crashing
This commit is contained in:
		
							parent
							
								
									0f1115b058
								
							
						
					
					
						commit
						d427dc6ea1
					
				@ -17,7 +17,7 @@ const TARGET_FIELD = 'targetField';
 | 
				
			|||||||
export const useTopRecord = () => {
 | 
					export const useTopRecord = () => {
 | 
				
			||||||
  let record = useRecord();
 | 
					  let record = useRecord();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  while (record && Object.keys(record.__parent).length > 0) {
 | 
					  while (record?.__parent && Object.keys(record.__parent).length > 0) {
 | 
				
			||||||
    record = record.__parent;
 | 
					    record = record.__parent;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  return record;
 | 
					  return record;
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user