Unnecessary log remove and null pointer check