// Do not remove this try catch block.
-
try
{
Filtering = !filters.IsEmpty;
}
catch(Exception ex)
{
// Do not remove this try catch block. For some reason this always throws Null reference exception but then works.
}
finally
{
Filtering = !filters.IsEmpty;
}Oh My eyes :wtf:
Yusuf May I help you?
-
try
{
Filtering = !filters.IsEmpty;
}
catch(Exception ex)
{
// Do not remove this try catch block. For some reason this always throws Null reference exception but then works.
}
finally
{
Filtering = !filters.IsEmpty;
}Oh My eyes :wtf:
Yusuf May I help you?
Oh go on, you know you want to.. :laugh:
try
{
Filtering = !filters.IsEmpty;
}
catch(Exception ex)
{
Filtering = !filters.IsEmpty;
}
finally
{
Filtering = !filters.IsEmpty;
}Ah, I see you have the machine that goes ping. This is my favorite. You see we lease it back from the company we sold it to and that way it comes under the monthly current budget and not the capital account.
-
Oh go on, you know you want to.. :laugh:
try
{
Filtering = !filters.IsEmpty;
}
catch(Exception ex)
{
Filtering = !filters.IsEmpty;
}
finally
{
Filtering = !filters.IsEmpty;
}Ah, I see you have the machine that goes ping. This is my favorite. You see we lease it back from the company we sold it to and that way it comes under the monthly current budget and not the capital account.
-
I want my filters to be NON-EMPTY!!!! I'll get my filters to be NON-EMPTY!!! :| :laugh: And why not just? :
Filtering = true;
If it throwing an exception on that, then maybe it is the
Filtering
var that is undefined?Hammer. Bigger Hammer. Biggest Hammer. :laugh:
Ah, I see you have the machine that goes ping. This is my favorite. You see we lease it back from the company we sold it to and that way it comes under the monthly current budget and not the capital account.
-
try
{
Filtering = !filters.IsEmpty;
}
catch(Exception ex)
{
// Do not remove this try catch block. For some reason this always throws Null reference exception but then works.
}
finally
{
Filtering = !filters.IsEmpty;
}Oh My eyes :wtf:
Yusuf May I help you?
At least make it catch only null reference exceptions? And let Bob sort out the rest?
-
try
{
Filtering = !filters.IsEmpty;
}
catch(Exception ex)
{
// Do not remove this try catch block. For some reason this always throws Null reference exception but then works.
}
finally
{
Filtering = !filters.IsEmpty;
}Oh My eyes :wtf:
Yusuf May I help you?
-
try
{
Filtering = !filters.IsEmpty;
}
catch(Exception ex)
{
// Do not remove this try catch block. For some reason this always throws Null reference exception but then works.
}
finally
{
Filtering = !filters.IsEmpty;
}Oh My eyes :wtf:
Yusuf May I help you?
I am trying to figure out how that can work. What about
private Something _filters;
private Something filters
{
get
{
if (_filters == null)
{
Task.Run(() => CreateFilters());
}
return _filters;
}
}
private void CreateFilters()
{
// somehow instantiates a Something and sets the _filters member
}That could cause such a strange behavior, couldn't it? :-D
-
try
{
Filtering = !filters.IsEmpty;
}
catch(Exception ex)
{
// Do not remove this try catch block. For some reason this always throws Null reference exception but then works.
}
finally
{
Filtering = !filters.IsEmpty;
}Oh My eyes :wtf:
Yusuf May I help you?
-
I am trying to figure out how that can work. What about
private Something _filters;
private Something filters
{
get
{
if (_filters == null)
{
Task.Run(() => CreateFilters());
}
return _filters;
}
}
private void CreateFilters()
{
// somehow instantiates a Something and sets the _filters member
}That could cause such a strange behavior, couldn't it? :-D
I think he might not know what Multi-Threaded Programming is.
-
try
{
Filtering = !filters.IsEmpty;
}
catch(Exception ex)
{
// Do not remove this try catch block. For some reason this always throws Null reference exception but then works.
}
finally
{
Filtering = !filters.IsEmpty;
}Oh My eyes :wtf:
Yusuf May I help you?
-
try
{
Filtering = !filters.IsEmpty;
}
catch(Exception ex)
{
// Do not remove this try catch block. For some reason this always throws Null reference exception but then works.
}
finally
{
Filtering = !filters.IsEmpty;
}Oh My eyes :wtf:
Yusuf May I help you?
My guess is that either "filters" isn't instantiated or is getting instantiated at the same time that it is being called. What is happening when "IsEmpty" is called? It might be trying to kick something off when it is called.
-
My guess is that either "filters" isn't instantiated or is getting instantiated at the same time that it is being called. What is happening when "IsEmpty" is called? It might be trying to kick something off when it is called.
I second that request. Can we be shown the IsEmpty code please? Can't be too many company secrets hidden in there... god, please say there isn't! :omg:
-
try
{
Filtering = !filters.IsEmpty;
}
catch(Exception ex)
{
// Do not remove this try catch block. For some reason this always throws Null reference exception but then works.
}
finally
{
Filtering = !filters.IsEmpty;
}Oh My eyes :wtf:
Yusuf May I help you?
Outside of that... Who knows the context, but I'm going to guess that filters is a private member property, and Filtering is exposed. Why wouldn't someone just make Filtering a public, get-only convenience property then, rather than setting some piece of data, where we now have to maintain two things?
-
I think he might not know what Multi-Threaded Programming is.
Exactly. But somewhere he read something about lazy initialization, and somewhere else he saw a Task.Run, understood neither of them, and ... Welcome to the wonderful world of code monkeys who've used every programming concept during their career. :^)
-
I second that request. Can we be shown the IsEmpty code please? Can't be too many company secrets hidden in there... god, please say there isn't! :omg:
public bool IsEmpty
{
get {
try {
return _filters.IsEmpty();
}
catch (NullReferenceException e)
{
InstantiateFilters();
throw new NullReferenceException("Try it again now please.");
}
}
} -
try
{
Filtering = !filters.IsEmpty;
}
catch(Exception ex)
{
// Do not remove this try catch block. For some reason this always throws Null reference exception but then works.
}
finally
{
Filtering = !filters.IsEmpty;
}Oh My eyes :wtf:
Yusuf May I help you?
-
try
{
Filtering = !filters.IsEmpty;
}
catch(Exception ex)
{
// Do not remove this try catch block. For some reason this always throws Null reference exception but then works.
}
finally
{
Filtering = !filters.IsEmpty;
}Oh My eyes :wtf:
Yusuf May I help you?
-
Nope. filter is ICollectionView [^](https://msdn.microsoft.com/en-us/library/system.componentmodel.icollectionview(v=vs.110).aspx) type. It is possible it could be null.
Yusuf May I help you?
-
I am trying to figure out how that can work. What about
private Something _filters;
private Something filters
{
get
{
if (_filters == null)
{
Task.Run(() => CreateFilters());
}
return _filters;
}
}
private void CreateFilters()
{
// somehow instantiates a Something and sets the _filters member
}That could cause such a strange behavior, couldn't it? :-D
var filters = Grid.RecordManager.FilteredInDataItems;
it is using 3rd party grid control. It returns ICollectionView [^](https://msdn.microsoft.com/en-us/library/system.componentmodel.icollectionview(v=vs.110).aspx)
Yusuf May I help you?
-
I second that request. Can we be shown the IsEmpty code please? Can't be too many company secrets hidden in there... god, please say there isn't! :omg: