prevent fatal when passing null to getInnerHtml

passing null was causing a fatal error, instead allow it and add
some debug logging to indicate there is a problem.

Change-Id: Idbe23d14ae963bfac13d7fb7e2b6b2ea1080cd64