How to overcome the exception object reference not set to an instance of object?
Check the value against null.