Bug 820022 - Add null check for layerView. r=margaret, a=bajaj