Skip to content
Browse files

Comment out exception thrown by Generator.Current if a generator does…

… not exist. This is because unit tests do not create a generator.
  • Loading branch information...
1 parent 47ac424 commit 6ceca2668bc978c933cb096c2df8742ff09c5716 @corliss corliss committed Mar 21, 2014
Showing with 4 additions and 3 deletions.
  1. +2 −1 Source/Eto/Forms/IDataStore.cs
  2. +2 −2 Source/Eto/Generator.cs
View
3 Source/Eto/Forms/IDataStore.cs
@@ -107,7 +107,8 @@ public void AddRange(IEnumerable<T> items)
Items.Add(item);
// range is not supported by WPF, so send a reset
- if (Generator.Current.IsWpf)
+ if (Generator.Current != null &&
+ Generator.Current.IsWpf)
OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset));
else
OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add, itemList, oldIndex));
View
4 Source/Eto/Generator.cs
@@ -236,8 +236,8 @@ public static Generator Current
{
get
{
- if (current == null)
- throw new EtoException("Generator has not been initialized");
+ //if (current == null)
+ // throw new EtoException("Generator has not been initialized");
return current;
}
}

0 comments on commit 6ceca26

Please sign in to comment.
Something went wrong with that request. Please try again.