Bug 861636. Add some null checking to the ensure texture path. r=nical