Skip to content
This repository was archived by the owner on Aug 23, 2023. It is now read-only.
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 19adb83

Browse files
Dieterbewoodsaj
authored and
woodsaj
committedOct 16, 2018
bugfix: detect <0 (public) org id's
1 parent 2fb95ae commit 19adb83

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed
 

‎idx/bigtable/schema.go

+4-3
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ func DecodeRowKey(key string) (string, int32, error) {
4949
// RowToSchema takes a row and unmarshals the data into the provided MetricDefinition.
5050
func RowToSchema(row bigtable.Row, def *schema.MetricDefinition) error {
5151
if def == nil {
52-
return fmt.Errorf("cant write row to nill MetricDefinition")
52+
return fmt.Errorf("cant write row to nil MetricDefinition")
5353
}
5454
columns, ok := row[COLUMN_FAMILY]
5555
if !ok {
@@ -76,9 +76,10 @@ func RowToSchema(row bigtable.Row, def *schema.MetricDefinition) error {
7676
if err != nil {
7777
return err
7878
}
79-
def.OrgId = uint32(val)
80-
if def.OrgId < 0 {
79+
if val < 0 {
8180
def.OrgId = idx.OrgIdPublic
81+
} else {
82+
def.OrgId = uint32(val)
8283
}
8384
case "Name":
8485
def.Name = string(col.Value)

0 commit comments

Comments
 (0)
This repository has been archived.