オブジェクトのインスタンスに設定されていないオブジェクト参照を取得します。:OperatorAssembly:0行157。この例外をトリガーする原因がわかりません。
LogFile.Info("order="+order.Id);
if (order.Location != null)
{
LogFile.Info("order=" + order.Location.Address);
}
else
{
LogFile.Info("order location is null");
}
LogFile.Info("order=" + order.Location.Latitude);
LogFile.Info("order=" + order.IsResolved);
LogFile.Info("order user id=" + order.User.Id);
LogFile.Info("order ser name=" + order.User.Name);
LogFile.Info("order ser dest =" + order.Destination.Address);
line 157:
result = new OrderDataDriver
{
OrderId = order.Id,
Address = order.Location.Address,
Lat = order.Location.Latitude,
Lng = order.Location.Longitude,
DestinationAddress = order.Destination.Address,
DestinationLat = order.Destination.Latitude,
DestinationLng = order.Destination.Longitude,
IsCanceled = order.IsCanceled,
IsPendingResponse = order.IsPendingResponse,
IsResolved = order.IsResolved,
UserId = order.User.Id,
Message = order.MessageForDriver,
UserName = order.User.Name,
// IsAdvanceBooking = order.AdvenceBookingTime != null,
AdvanceBookingTime = order.AdvenceBookingTime,
AdvancePrice = order.CalculatedPrice,
AdvanceDistance = order.CalculatedDistance,
SecondsToRespond = 30,
Status=order.DriverStatus
};
[DataContract]
public class OrderDataDriver
{
[DataMember] public string Address { get; set; }
[DataMember] public string Feedback { get; set; }
[DataMember] public double Lat { get; set; }
[DataMember] public double Lng { get; set; }
[DataMember] public int UserId { get; set; }
[DataMember] public string Status { get; set; }
[DataMember] public bool? IsEligible { get; set; }
[DataMember] public bool? IsCanceled { get; set; }
[DataMember] public bool? IsResolved { get; set; }
[DataMember] public bool? IsPendingResponse { get; set; }
[DataMember] public bool? AllowsTracking { get; set; }
[DataMember]
public int OrderId { get; set; }
[DataMember]
public int App { get; set; }
[DataMember]
public int? PreferedDriver { get; set; }
[DataMember]
public bool IsAdvanceBooking { get; set; }
[DataMember]
public DateTime? AdvanceBookingTime { get; set; }
[DataMember]
public double? AdvancePrice { get; set; }
[DataMember]
public double? AdvanceDistance { get; set; }
[DataMember]
public string DestinationAddress { get; set; }
[DataMember]
public double DestinationLat { get; set; }
[DataMember]
public double DestinationLng { get; set; }
[DataMember]
public string Message { get; set; }
[DataMember]
public string UserName { get; set; }
[DataMember]
public int SecondsToRespond { get; set; }
}