fixed GH #376: Defect: checking null value when using the same statement multiple times.