Skip to content

Commit c399ca3

Browse files
committed
Fix crash when non-supported chars are used as table column names
1 parent ccc6720 commit c399ca3

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

influxdb-client/SeriesResult.m

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@
5252

5353
% Convert to a table
5454
function result = table(obj)
55-
result = table(obj.Values{:}, 'VariableNames', obj.Fields);
55+
names = genvarname(obj.Fields);
56+
result = table(obj.Values{:}, 'VariableNames', names);
5657
end
5758

5859
% Convert to a timetable, with an optional timezone
@@ -64,7 +65,8 @@
6465
else
6566
time = obj.time();
6667
end
67-
result = timetable(time, obj.Values{:}, 'VariableNames', obj.Fields);
68+
names = genvarname(obj.Fields);
69+
result = timetable(time, obj.Values{:}, 'VariableNames', names);
6870
end
6971
end
7072

0 commit comments

Comments
 (0)