Skip to content

Commit

Permalink
Prevent crash caused by None fallback value for var()
Browse files Browse the repository at this point in the history
The INITIAL_VALUES for anchor, link and lang (oops, css properties!?) is None.

If the fallback value is None there is no use in calling the @registered
function. Just return None.
  • Loading branch information
Tontyna committed Oct 23, 2019
1 parent 11cc765 commit d0eeeba
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions weasyprint/css/computed_values.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,9 @@ def compute(element, pseudo_type, specified, computed, parent_style,
value = INITIAL_VALUES[name]
else:
value = new_value
# no value, no fallback, no need for a function call
if value is None:
function = None

if function is not None:
value = function(computer, name, value)
Expand Down

0 comments on commit d0eeeba

Please sign in to comment.