Made get connected resources routine safe

now requesting an unknown resource will return an amount of 0 instead of
crashing code