Allow accessing null inputs
This commit is contained in:
parent
9244ab6c21
commit
4acb8689c3
|
|
@ -19,7 +19,7 @@ public class ExpressionExecutionContext
|
|||
public RegisterLocation GetLocation(RegisterLocationReference locationReference) => GetLocationInternal(locationReference) ?? throw new InvalidOperationException();
|
||||
public object Get(RegisterLocationReference locationReference) => GetLocation(locationReference).Value!;
|
||||
public T Get<T>(RegisterLocationReference locationReference) => (T)Get(locationReference);
|
||||
public T? Get<T>(Input<T> input) => (T?)GetLocation(input.LocationReference).Value;
|
||||
public T? Get<T>(Input<T>? input) => input != null ? (T?)GetLocation(input.LocationReference).Value : default;
|
||||
|
||||
public void Set(RegisterLocationReference locationReference, object? value)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -15,5 +15,5 @@ public class TriggerIndexingContext
|
|||
Trigger = trigger;
|
||||
}
|
||||
|
||||
public T? Get<T>(Input<T> input) => ExpressionExecutionContext.Get<T>(input);
|
||||
public T? Get<T>(Input<T>? input) => ExpressionExecutionContext.Get(input);
|
||||
}
|
||||
|
|
@ -13,7 +13,7 @@ public class MessageReceived : TriggerActivity
|
|||
protected override object GetPayload(TriggerIndexingContext context)
|
||||
{
|
||||
var queueOrTopic = context.Get(QueueOrTopic)!;
|
||||
var subscription = context.Get(Subscription!)!;
|
||||
var subscription = context.Get(Subscription);
|
||||
return new MessageReceivedTriggerPayload(queueOrTopic, subscription);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue