When adding a new layer to the project, it can be done by specifying all of the parameters, or only some of them. In the case where the layer is added without specifying all parameters, the code crashes when attempting to convert to a struct, because the empty values cannot be found in the list of parameters.
@arwelHughes what behaviour should we expect here?
