fix for NPE when given 'path' is null