Commit ecb2f329 authored by Masayuki Tanaka's avatar Masayuki Tanaka

Fix targets is undefined in hasType - #618

parent 2035754c
......@@ -3146,7 +3146,7 @@
c3_chart_internal_fn.hasType = function (type, targets) {
var $$ = this, types = $$.config.data_types, has = false;
targets = targets || $$.data.targets;
if (targets.length) {
if (targets && targets.length) {
targets.forEach(function (target) {
var t = types[target.id];
if ((t && t.indexOf(type) >= 0) || (!t && type === 'line')) {
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -11,7 +11,7 @@ c3_chart_internal_fn.setTargetType = function (targetIds, type) {
c3_chart_internal_fn.hasType = function (type, targets) {
var $$ = this, types = $$.config.data_types, has = false;
targets = targets || $$.data.targets;
if (targets.length) {
if (targets && targets.length) {
targets.forEach(function (target) {
var t = types[target.id];
if ((t && t.indexOf(type) >= 0) || (!t && type === 'line')) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment