Patch for "find_or_create_by_id"

With latest version method find_or_create_by_id throw exception when id is NIL. This is patch for repair that bug.