By first checking if the list has any matches before potentially making it detach. Change-Id: I7a42c2910ef6efc45033e562573414a3a9ef972e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>