adding check for NAs before attempting to use their values in maths.
adding check for NAs before attempting to use their values in maths.

this should take care of the issue seen in AQCU-639

lindsaycarr/repgen,thongsav-usgs/repgen,USGS-R/repgen,dpattermann-usgs/repgen,thongsav-usgs/repgen,zmoore-usgs/repgen,dpattermann-usgs/repgen,USGS-R/repgen,lindsaycarr/repgen,mhines-usgs/repgen,mhines-usgs/repgen,mhines-usgs/repgen,zmoore-usgs/repgen,dpattermann-usgs/repgen,thongsav-usgs/repgen,zmoore-usgs/repgen,lindsaycarr/repgen,USGS-R/repgen