Added validation for when the attribute 'value' is empty

If the 'value' attribute exists, but it is empty, the code breaks.