-
Type: Bug
-
Resolution: Unresolved
-
Priority: Minor - P4
-
None
-
Affects Version/s: None
-
Component/s: None
-
2 - S (<= 1 week)
-
4773
How frequently does the bug occur?
All the time
Description
If you have a schema with a date field and you would try to save new Date(NaN) into it, Realm would crash. In this case, it is an obvious error from the user, but shouldn't it be handled more gracefully?
Stacktrace & log output
Unable to find source-code formatter for language: shell. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
libc++abi: terminating with uncaught exception of type std::invalid_argument: Value 'Invalid Date' not convertible to a number.
Can you reproduce the bug?
Yes, always
Reproduction Steps
Unable to find source-code formatter for language: ts. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
realm.write(() => { realm.create('Task', {date: new Date(NaN)}, 'all'); });
Version
10.19.5
What SDK flavour are you using?
Local Database only
Are you using encryption?
No, not using encryption
Platform OS and version(s)
iOS 15.6
Build environment
No response
Cocoapods version
No response