Skip to content

Commit a040ea7

Browse files
committed
debug unhandled error
1 parent b45228e commit a040ea7

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/plugins/validators/async/22_imageSize.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { cache } from '../../../cache.js';
33
import mediaPlugin from '../media.js';
44
import * as urlLib from 'url';
55

6-
76
export default {
87

98
startIteration: function(iterationPluginContext) {
@@ -98,6 +97,10 @@ export default {
9897

9998
// Special case: add rel image for image file with specific size.
10099
if (link.rel.indexOf(CONFIG.R.image) === -1 && link.rel.indexOf(CONFIG.R.file) > -1 && data.width >= 100 && data.height >= 100) {
100+
if (typeof link.rel.push !== 'function') {
101+
throw new Error('link rel type error: "' + url + '" ' + JSON.stringify(link));
102+
}
103+
101104
link.rel.push(CONFIG.R.image);
102105
}
103106

0 commit comments

Comments
 (0)