fix removal of undefined layer

fixes libremap/libremap-webui#1