Skip to content

Commit c298c76

Browse files
author
Adrien Thiery
committed
Do not return anything if no opengraph tag is found
1 parent 8716dfd commit c298c76

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

OpenGraphParser.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,11 @@ function parseMeta(html, url) {
4646

4747
meta[metaName] = decodeHTMLChars(metaValue);
4848
}
49-
}
5049

51-
return meta;
50+
return meta;
51+
} else {
52+
return null;
53+
}
5254
}
5355

5456
async function fetchHtml(urlToFetch) {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-opengraph-kit",
3-
"version": "1.3.0",
3+
"version": "1.3.1",
44
"description": "A set of components and utils useful to extract opengraph data directly from your react-native app",
55
"main": "index.js",
66
"devDependencies": {

0 commit comments

Comments
 (0)