MaterialFoundry / MaterialDeck

41 stars 20 forks source link

Fixing undefined device when looping over buttonContext. #85

Closed InnerGI closed 2 years ago

InnerGI commented 3 years ago

When looping over this.buttonContext within clearContext and setIcon methods, there are empty array entries. To avoid the loop being aborted early, we add an optional chain before trying to access '.device' from an empty array entry.

Example Errors before this fix:

image