Don't render infinitely large document if empty.

Change-Id: I887d8cef0c24b1e5155969a9f571660ca54ef463