Added check that ipDir is valid.

If ipDir is not a directory then the layer is not added and a warning is logged.