Skip to content

Commit

Permalink
fix: only index cachedData once
Browse files Browse the repository at this point in the history
  • Loading branch information
aminya committed Jan 1, 2021
1 parent 2954140 commit 4e753ad
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/dom-styles-reader.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,11 @@ export default class DOMStylesReader {
const key = scopes.join(' ')
let cachedData = this.domStylesCache.get(key)

if (cache && (cachedData !== undefined ? cachedData[property] : undefined) != null) {
return cachedData[property]
if (cache && cachedData !== undefined) {
const value = cachedData[property]
if (value != null) {
return value
}
}

this.ensureDummyNodeExistence(targetNode)
Expand Down

0 comments on commit 4e753ad

Please sign in to comment.