fix an exception when trying to convert empty code