[Groonga-commit] groonga/gcs [master] Don't reise error even if there is no creation date

Zurück zum Archiv-Index

YUKI Hiroshi null+****@clear*****
Wed Dec 5 18:24:31 JST 2012


YUKI Hiroshi	2012-12-05 18:24:31 +0900 (Wed, 05 Dec 2012)

  New Revision: 754436e208482ba627cd6a56a26162ab9cca4920
  https://github.com/groonga/gcs/commit/754436e208482ba627cd6a56a26162ab9cca4920

  Log:
    Don't reise error even if there is no creation date

  Modified files:
    lib/database/index-field.js

  Modified: lib/database/index-field.js (+10 -4)
===================================================================
--- lib/database/index-field.js    2012-12-05 17:40:59 +0900 (aa9c70f)
+++ lib/database/index-field.js    2012-12-05 18:24:31 +0900 (22b7287)
@@ -486,8 +486,11 @@ IndexField.prototype = {
   },
 
   get createdAt() {
-    if (this.exists() && !this._createdAt)
-      this._createdAt = new Date(this.domain.getConfiguration(this.createdAtKey));
+    if (this.exists() && !this._createdAt) {
+      var createdAt = this.domain.getConfiguration(this.createdAtKey);
+      if (createdAt)
+        this._createdAt = new Date(createdAt);
+    }
     return this._createdAt || new Date();
   },
   set createdAt(value) {
@@ -501,8 +504,11 @@ IndexField.prototype = {
   },
 
   get updatedAt() {
-    if (this.exists() && !this._updatedAt)
-      this._updatedAt = new Date(this.domain.getConfiguration(this.updatedAtKey));
+    if (this.exists() && !this._updatedAt) {
+      var updatedAt = this.domain.getConfiguration(this.updatedAtKey);
+      if (updatedAt)
+        this._updatedAt = new Date(updatedAt);
+    }
     return this._updatedAt || new Date();
   },
   set updatedAt(value) {
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Zurück zum Archiv-Index