diff --git a/lib/index.js b/lib/index.js index d0044f5..54a5601 100644 --- a/lib/index.js +++ b/lib/index.js @@ -224,6 +224,7 @@ var WalkThru = (function (_Component) { var steps = _state2.steps; if (!___portal) return null; + if (steps.length === 0) return null; var current = steps[step - 1]; diff --git a/package.json b/package.json index 6a10b44..257e82b 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "description": "Easy to use step-by-step site guide component for React.", "main": "lib/index.js", "scripts": { - "start-dev": "babel ./src --watch --out-dir ./lib & npm link && cd demo && npm install && npm link walkthru && npm run start-dev", + "start-dev": "babel ./src --watch --out-dir ./lib & cd demo && npm install && npm run start-dev", "prebuild": "rm -rf lib/*", "build": "babel ./src --out-dir ./lib", "prepublish": "npm run build" diff --git a/src/index.js b/src/index.js index eaa0b6e..b1e18d4 100644 --- a/src/index.js +++ b/src/index.js @@ -164,6 +164,7 @@ export default class WalkThru extends Component { const { show, step, steps } = this.state; if (!___portal) return null; + if (steps.length === 0) return null; const current = steps[step - 1];