shr-cookie-policy)))
(defun shr--preferred-image (dom)
- (let* ((srcset (shr--parse-srcset (dom-attr dom 'srcset)
- (and (dom-attr dom 'width)
- (string-to-number
- (dom-attr dom 'width)))))
+ (let* ((srcset (and (dom-attr dom 'srcset)
+ (shr--parse-srcset (dom-attr dom 'srcset)
+ (and (dom-attr dom 'width)
+ (string-to-number
+ (dom-attr dom 'width))))))
(frame-width (frame-pixel-width))
candidate)
- (when (length> srcset 0)
+ (when srcset
;; Choose the smallest picture that's bigger than the current
;; frame.
(setq candidate (caar srcset))