software-students-fall2021 / project-setup-penguin

project-setup-penguin created by GitHub Classroom
3 stars 4 forks source link

only set text if element is found #190

Closed janethuangg closed 2 years ago

janethuangg commented 2 years ago

previously, if a user clicked the share button in the deck view and then quickly navigated away from the page, it would raise an error because we would try to set the text on an element that was no longer in the DOM

this PR checks to see if the share text element exists before resetting its value