Added null check in assertCurrentActivity