Make sure duration isn't null before parsing it.