* Check for null format argument in Date.format()
This commit is contained in:
parent
b64c845258
commit
f84ab79675
1 changed files with 1 additions and 2 deletions
|
@ -1059,7 +1059,7 @@ public final class RhinoCore implements ScopeProvider {
|
||||||
Date date = new Date((long) ScriptRuntime.toNumber(thisObj));
|
Date date = new Date((long) ScriptRuntime.toNumber(thisObj));
|
||||||
SimpleDateFormat df = null;
|
SimpleDateFormat df = null;
|
||||||
|
|
||||||
if (args.length > 0 && args[0] != Undefined.instance) {
|
if (args.length > 0 && args[0] != Undefined.instance && args[0] != null) {
|
||||||
if (args.length > 1 && args[1] instanceof NativeJavaObject) {
|
if (args.length > 1 && args[1] instanceof NativeJavaObject) {
|
||||||
Object locale = ((NativeJavaObject) args[1]).unwrap();
|
Object locale = ((NativeJavaObject) args[1]).unwrap();
|
||||||
if (locale instanceof Locale) {
|
if (locale instanceof Locale) {
|
||||||
|
@ -1125,4 +1125,3 @@ public final class RhinoCore implements ScopeProvider {
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue