NcML aggregations are calling UrlNaming.resolveFile with the dataset URL as the baseDir and the netcdf location as the filepath. This is causing a nullptr exception in the MFileOS::getParent call when the dataset URL does not have any slashes so the parent is null. Maybe this function should not be called at all in this case (the URL is not a baseDir so it is a bit weird), but in any case this nullptr exception should be fixed. This PR fixes the nullptr exception in MFileOS and adds unit tests.
Description of Changes
NcML aggregations are calling
UrlNaming.resolveFile
with the dataset URL as thebaseDir
and the netcdf location as thefilepath
. This is causing a nullptr exception in theMFileOS::getParent
call when the dataset URL does not have any slashes so the parent is null. Maybe this function should not be called at all in this case (the URL is not a baseDir so it is a bit weird), but in any case this nullptr exception should be fixed. This PR fixes the nullptr exception inMFileOS
and adds unit tests.