NW-2567: fixed crash when calling getLayerType on a layer with no source (happens with TextLayer)