Cast an object to Decimal? or Int? etc but leave it as null if it is null
If you know that the object is always either double or null, then that's exactly what the double? type can represent and you can convert to that using a cast:

object obj = ...;
double? doubleValue = (double?)obj;


And once you have double?, you can cast it to decimal? and it will work both for the case when the value is null and when isn't:

decimal? decimalValue = (decimal?)doubleValue;


Or, on a single line:

decimal? decimalValue = (decimal?)(double?)obj;


Apart from being clear, this approach is also likely going to be pretty efficient.