       # @returns a string with the leading digit sequence converted
       #    to a roman numeral
       (value) ->
-        value.toString().replace(/^\d+/, roman.romanize)
+        value.toString().replace(/^\d+/, roman.romanize) if value?
     ]
 
 
     filters.filter 'moment', ->
-      (s) -> moment(s).format('MM/DD/YYYY')
+      (s) -> moment(s).format('MM/DD/YYYY') if s?
 
 
     filters.filter 'notSpecified', ->

                         'qiprofile.tnm', 'qiprofile.image']

    filters.filter 'capitalize', ->
      (s) -> _s.capitalize(s)


    filters.filter 'underscore', ->
      (s) -> _s.underscored(s)


    filters.filter 'romanize', ['StringHelper', (StringHelper) ->



    filters.filter 'percent', ->
      (value) -> value * 100 if value?

    filters.filter 'imageContainerTitle', ->
      # If the image container name ends with _reg, then it is a registation.
      # Otherwise, it is a scan.
      (value) ->
        if value.startsWith('reg')
          'Registration ' + value
