Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Empty src causes component crash #36

Open
MichalBryxi opened this issue Jun 5, 2016 · 0 comments
Open

Empty src causes component crash #36

MichalBryxi opened this issue Jun 5, 2016 · 0 comments

Comments

@MichalBryxi
Copy link
Contributor

Steps to reproduce:

  1. Take sample photoswipe code.
  2. Set src of some property for the gallery to empty string (anything that does not resolve to image will do).
  3. Display the gallery in browser and click on the image to enlarge it.
  4. Observe that there is error in console.

Sample data:

  moo: [
  {
    src: 'http://placekitten.com/g/600/400',
    w: 600,
    h: 400,
    title: 'whooa',
    msrc: '(optional) larger image'
  },
  {
    src: '',
    w: 600,
    h: 400,
    title: 'whooa',
    msrc: '(optional) larger image'
  }
]

With that data I get following error:

ember.debug.js:16591 Uncaught Error: Assertion Failed: You must use Ember.set() to set the `h` property (of [object Object]) to `0`.

and following stack trace.

I found the line in photoswipe source which causes this.

In general, I think ember-cli-photoswipe should pass only plain JSON objects to photoswipe library, because there might be also other cases in which photoswipe changes input data and thus makes EmberJS freak out.

@MichalBryxi MichalBryxi changed the title Empty src causes component to crash Empty src causes component crash Jun 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant