I built my project locally and it worked with a code similar to the following:
bool success = true; int y = 0; int? x = success ? y : null;
B