check that remotePath is not NULL

a error will be thrown is remotePath is NULL

"Cannot read property 'blue' of null"