mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-15 18:30:27 -04:00
Allow nil to be passed to optional type-specific arguments, making them return their default value.
For #2232.
This commit is contained in:
parent
5c76be7fc5
commit
ce304ea248
@ -196,7 +196,7 @@ class ArgumentsImpl(val args: Seq[AnyRef]) extends Arguments {
|
||||
case value => value
|
||||
}.toArray
|
||||
|
||||
private def isDefined(index: Int) = index >= 0 && index < args.length
|
||||
private def isDefined(index: Int) = index >= 0 && index < args.length && args(index) != null
|
||||
|
||||
private def checkIndex(index: Int, name: String) =
|
||||
if (index < 0) throw new IndexOutOfBoundsException()
|
||||
|
Loading…
x
Reference in New Issue
Block a user