Fixed nullpointer when not providing a map with variant -> app id. Will now throw an exception if a map is provided, but a match is not found to avoid having an arbitrary app being overwritten.