The G4LogicalVolume object always has a null pointer?

I wanted to use DetectorConstructionMessenger class to change the material of a cell,
but it seems the G4LogicalVolume object always has a null pointer,
the resolution of changing the material is coded as:
void fpDetectorConstruction::SetModerMaterial(G4String sValue)
{
// search the material by its name
G4cout<<“111111111111111111111111111111111111111111111111111111111”<<G4endl;
G4Material* pttoMaterial =
G4NistManager::Instance()->FindOrBuildMaterial(sValue);
G4cout<<“222222222222222222222222222222222222222222222222222222222”<<G4endl;
//
if (pttoMaterial) {
G4cout<<“333333333333333333333333333333333333333333333333333333333”<<G4endl;
fModerMaterial = pttoMaterial;
G4cout<<“444444444444444444444444444444444444444444444444444444444”<<G4endl;
if(fLogicalModer) {
G4cout<<“555555555555555555555555555555555555555555555555555555555”<<G4endl;
fLogicalModer->SetMaterial(fModerMaterial);
G4cout<<“666666666666666666666666666666666666666666666666666666666”<<G4endl;
}
G4cout<<“777777777777777777777777777777777777777777777777777777777”<<G4endl;
G4RunManager::GetRunManager()->PhysicsHasBeenModified();
G4cout<<“888888888888888888888888888888888888888888888888888888888”<<G4endl;
//
}
else {
G4cout << “\n → warning from DetectorConstruction::SetMaterial : "
<< sValue << " not found” << G4endl;
}
}
when the resolution was called, the information from the terminal is:
testhadr/det/setMat C2H4_B2O3
111111111111111111111111111111111111111111111111111111111
222222222222222222222222222222222222222222222222222222222
333333333333333333333333333333333333333333333333333333333
444444444444444444444444444444444444444444444444444444444
777777777777777777777777777777777777777777777777777777777
888888888888888888888888888888888888888888888888888888888

so, the G4LogicalVolume pointer “fLogicalModer” point to null.

by the way, the other commands from the DetectorConstructionMessenger work well.

what the mistake might be?