We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bb5144a commit b50c92aCopy full SHA for b50c92a
libs/gdal/frmts/gsky_netcdf/netcdfdataset.cpp
@@ -7295,7 +7295,10 @@ GDALDataset *netCDFDataset::Open( GDALOpenInfo *poOpenInfo )
7295
7296
const char *mainVarLookup = CSLFetchNameValue(poOpenInfo->papszOpenOptions, "var_id_query");
7297
if(mainVarLookup != nullptr) {
7298
- poDS->mainVariableId = (char *)poDS->FetchAttr("NC_GLOBAL", mainVarLookup);
+ char *varId = (char *)poDS->FetchAttr("NC_GLOBAL", mainVarLookup);
7299
+ if(poDS->mainVariableId == nullptr && varId != nullptr) {
7300
+ poDS->mainVariableId = varId;
7301
+ }
7302
}
7303
7304
// Identify coordinate and boundary variables that we should
0 commit comments