mirror of
				https://github.com/NodeBB/NodeBB.git
				synced 2025-10-31 11:05:54 +01:00 
			
		
		
		
	fix: don't crash if content is undefined
This commit is contained in:
		| @@ -150,6 +150,7 @@ async function onMessage(socket, payload) { | |||||||
| 			}); | 			}); | ||||||
| 		} | 		} | ||||||
| 	} catch (err) { | 	} catch (err) { | ||||||
|  | 		winston.error(err.stack ? err.stack : err.message); | ||||||
| 		callback({ message: err.message }); | 		callback({ message: err.message }); | ||||||
| 	} | 	} | ||||||
| } | } | ||||||
|   | |||||||
| @@ -178,7 +178,10 @@ SocketPosts.editQueuedContent = async function (socket, data) { | |||||||
| 		throw new Error('[[error:invalid-data]]'); | 		throw new Error('[[error:invalid-data]]'); | ||||||
| 	} | 	} | ||||||
| 	await posts.editQueuedContent(socket.uid, data.id, data.content, data.title); | 	await posts.editQueuedContent(socket.uid, data.id, data.content, data.title); | ||||||
|  | 	if (data.content) { | ||||||
| 		return await plugins.fireHook('filter:parse.post', { postData: data }); | 		return await plugins.fireHook('filter:parse.post', { postData: data }); | ||||||
|  | 	} | ||||||
|  | 	return { postData: data }; | ||||||
| }; | }; | ||||||
|  |  | ||||||
| require('../promisify')(SocketPosts); | require('../promisify')(SocketPosts); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user