#146 Explicitly check if element id is null or undefined