You need to test if this.viewProfileAction defined, as is done above in handleClick