Skip to content

Commit

Permalink
Fix nightwatchjs#924 Not possible to create custom assertion with no …
Browse files Browse the repository at this point in the history
…arguments
  • Loading branch information
Zaharchenko committed Apr 28, 2016
1 parent a78a473 commit 0b6d3ef
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/page-object/command-wrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ module.exports = new (function() {
function makeWrappedCommand(parent, commandFn, commandName, isChaiAssertion) {
return function() {
var args = Array.prototype.slice.call(arguments);
var isElementCommand = args[0].toString().indexOf('@') === 0;
var isElementCommand = typeof args[0] !== 'undefined' && args[0].toString().indexOf('@') === 0;
var prevLocateStrategy = parent.client.locateStrategy;

if (isElementCommand) {
Expand Down

0 comments on commit 0b6d3ef

Please sign in to comment.