ivi_common: check that scan pattern is set before using it.