Node might be of a text type and thus not have the `getAttribute` method

This fixes the JS error that occurred on permissions page