Skip to content

Commit

Permalink
fix(core): fail-safe check of nullable value (#1031)
Browse files Browse the repository at this point in the history
Make sure the lookupStyle method in StyleUtils return a string. On old
browsers getPropertyValue() of getComputedStyle() returns a null instead
of empty string.

Fixes #958
  • Loading branch information
flugg authored and CaerusKaru committed Mar 7, 2019
1 parent af15a61 commit 5112a47
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/core/style-utils/style-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export class StyleUtils {

// Note: 'inline' is the default of all elements, unless UA stylesheet overrides;
// in which case getComputedStyle() should determine a valid value.
return value.trim();
return value ? value.trim() : '';
}

/**
Expand Down

0 comments on commit 5112a47

Please sign in to comment.