Add null check before accessing Layer
Merge remote-tracking branch 'origin/dev2' into dev2