Skip to content

Commit

Permalink
fix(msg): if default provided and property is missing, return default
Browse files Browse the repository at this point in the history
  • Loading branch information
mchitre committed Mar 17, 2024
1 parent 71407c1 commit 0f70379
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/msg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ end
# immutable dictionary interface for Messages

function Base.get(s::Message, p::Symbol, default)
hasproperty(s, p) || return default
v = getproperty(s, p)
v === nothing && return default
v
Expand Down

0 comments on commit 0f70379

Please sign in to comment.