Skip to content

Commit f6b1444

Browse files
Merge pull request #1255 from lamorton/bugfix
Fix for #1253
2 parents c8f792e + 0165775 commit f6b1444

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

src/systems/validation.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ get_unit(x::Literal) = screen_unit(getmetadata(x,VariableUnit, unitless))
4242
get_unit(op::Differential, args) = get_unit(args[1]) / get_unit(op.x)
4343
get_unit(op::Difference, args) = get_unit(args[1]) / get_unit(op.t)
4444
get_unit(op::typeof(getindex),args) = get_unit(args[1])
45+
get_unit(x::typeof(SciMLBase.NullParameters)) = unitless
46+
4547
function get_unit(op,args) # Fallback
4648
result = op(1 .* get_unit.(args)...)
4749
try

test/units.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ D = Differential(t)
1616
@test MT.get_unit(τ) == u"ms"
1717
@test MT.get_unit(γ) == MT.unitless
1818
@test MT.get_unit(0.5) == MT.unitless
19+
@test MT.get_unit(MT.SciMLBase.NullParameters) == MT.unitless
1920

2021
# Prohibited unit types
2122
@parameters β [unit = u"°"] α [unit = u"°C"] γ [unit = 1u"s"]

0 commit comments

Comments
 (0)