mirror of
				https://github.com/NodeBB/NodeBB.git
				synced 2025-10-31 19:15:58 +01:00 
			
		
		
		
	fix: resolveLocalId to return null values instead of throwing for no resolution
This commit is contained in:
		| @@ -107,15 +107,15 @@ Helpers.resolveLocalId = async (input) => { | ||||
| 				} | ||||
| 			} | ||||
|  | ||||
| 			throw new Error('[[error:activitypub.invalid-id]]'); | ||||
| 		} else { | ||||
| 			throw new Error('[[error:activitypub.invalid-id]]'); | ||||
| 			return { type: null, id: null }; | ||||
| 		} | ||||
|  | ||||
| 		return { type: null, id: null }; | ||||
| 	} else if (input.indexOf('@') !== -1) { // Webfinger | ||||
| 		const [slug] = input.replace(/^acct:/, '').split('@'); | ||||
| 		const uid = await user.getUidByUserslug(slug); | ||||
| 		return { type: 'user', id: uid }; | ||||
| 	} | ||||
|  | ||||
| 	throw new Error('[[error:activitypub.invalid-id]]'); | ||||
| 	return { type: null, id: null }; | ||||
| }; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user