Improved sanity check on RenderModel

Before we were not checking for null on viewport, which could cause
crashes in some models.  This check is added and moved up-front in the
RenderModel method.