type: fix undefined index in ds_names[$source] before empty check