Dom/issue51 templatepicker nullexception

@dotMorten For Code Review.