Adding a null check to Twitter Sample.