NPE check in getTimeInMillis()

added a null check to getTimeInMillis()
and remove the null passed parameters