nodebb-plugin-link-preview 1.3.0 → 1.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/library.js +5 -1
- package/package.json +1 -1
package/library.js
CHANGED
|
@@ -86,7 +86,7 @@ async function processAttachments({ content, pid, tid }) {
|
|
|
86
86
|
// Retrieve attachments
|
|
87
87
|
const hashes = await db.getSortedSetMembers(`post:${pid}:attachments`);
|
|
88
88
|
if (!hashes.length) {
|
|
89
|
-
return;
|
|
89
|
+
return content;
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
const keys = hashes.map(hash => `attachment:${hash}`);
|
|
@@ -173,6 +173,10 @@ async function process(content, opts) {
|
|
|
173
173
|
|
|
174
174
|
// Generate the preview, but continue for now so as to not block response
|
|
175
175
|
preview(url).then(async (preview) => {
|
|
176
|
+
if (!preview) {
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
|
|
176
180
|
const parsedUrl = new URL(url);
|
|
177
181
|
preview.hostname = parsedUrl.hostname;
|
|
178
182
|
|