Permalink
Browse files

Merge pull request #117 from chrisntr/master

Check to see if tableView.Source is not null
  • Loading branch information...
2 parents f635c15 + e000770 commit ac367eec037279ba8e186c22abd8751e48910925 @migueldeicaza committed Mar 30, 2012
Showing with 7 additions and 4 deletions.
  1. +7 −4 MonoTouch.Dialog/DialogViewController.cs
@@ -621,11 +621,14 @@ bool UsingIndexedTitles ()
// on an implementation detail; the base SectionIndexTitles() method to be implementated
// in UITableViewSource.
- MethodInfo m = tableView.Source.GetType().GetMethod("SectionIndexTitles", BindingFlags.Instance | BindingFlags.Public);
+ if(tableView.Source != null)
+ {
+ MethodInfo m = tableView.Source.GetType().GetMethod("SectionIndexTitles", BindingFlags.Instance | BindingFlags.Public);
- if (!m.DeclaringType.Name.Equals(typeof(UITableViewSource).Name)) {
- if (tableView.Source.SectionIndexTitles(tableView).Length > 0) {
- return true;
+ if (!m.DeclaringType.Name.Equals(typeof(UITableViewSource).Name)) {
+ if (tableView.Source.SectionIndexTitles(tableView).Length > 0) {
+ return true;
+ }
}
}

0 comments on commit ac367ee

Please sign in to comment.