Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Simon Dingley 1431 posts 3332 karma points c-trib
    Aug 29, 2012 @ 18:50
    Simon Dingley
    0

    Cannot perform runtime binding on a null reference on MediaPicker Property

    Despite all of these checks passing as true

    !string.IsNullOrEmpty(item.Image.ToString()) && item.HasProperty("Image") && item.HasValue("Image")

    Why do I still get "Cannot perform runtime binding on a null reference" exception when accessing the Image property:

    item.Image

    Long day - perhaps missing something obvious?

  • Douglas Ludlow 210 posts 366 karma points
    Aug 29, 2012 @ 18:54
    Douglas Ludlow
    0

    Hey Simon,

    I'm guessing maybe that you should be referencing item.image (lowercase) instead of item.Image.

  • Sebastiaan Janssen 4899 posts 14655 karma points MVP admin hq
    Aug 29, 2012 @ 18:57
    Sebastiaan Janssen
    0

    I think you should start with item.HasProp and item.HasValue before you actually try to do something with the value.

  • Simon Dingley 1431 posts 3332 karma points c-trib
    Aug 29, 2012 @ 20:46
    Simon Dingley
    0

    @Douglas I did try that and no joy

    @Sebastiaan - Thanks, the following sorted the issue

    item.HasProp("Image") && item.HasValue("Image") && !string.IsNullOrEmpty(item.Image.ToString())
  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies