[mono-android] NullException error
Tomasz Cielecki
tomasz at ostebaronen.dk
Sun Nov 20 13:19:45 EST 2011
tab is probably null then.
On Nov 20, 2011 2:32 AM, "Paul F. Johnson" <paul at all-the-johnsons.co.uk>
wrote:
> Hi,
>
> My (slowly) developing Android app seems to have come a cropper with a
> very unhelpful error message
>
> Unhandled Exception:
>
> System.NullReferenceException:
>
> and that's it.
>
> I have three tabs. Tab 2 has a reference to tab 1 like this
>
> public class tabTwo : Activity
> {
> tabOne tab;
> // etc
> }
>
> The button handler looks like this
>
> private void(object s, EventArgs e)
> {
> if (tab.var1 == 0 || tab.var2 == 0 || tab.var3 == 0)
> {
> // toast line - you can't have any of these to be zero
> return;
> }
> }
>
> The exception is at the tab.var1 line.
>
> Should the throwback be giving more information than that?
>
> Paul
> --
> Vertraue mir, ich weiss, was ich mache...
>
> _______________________________________________
> Monodroid mailing list
> Monodroid at lists.ximian.com
>
> UNSUBSCRIBE INFORMATION:
> http://lists.ximian.com/mailman/listinfo/monodroid
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/monodroid/attachments/20111120/81ac3020/attachment.html
More information about the Monodroid
mailing list