You need to sign in to do that
Don't have an account?
prazon
Visualforce Error Help for this Page Subscript is invalid because list is empty
Hi,
How to handle this error. Although I have put exception handler in the class this error is not getting trapped. If anybody knows kindly apprise me off
Regards
Prazon
Can you post the code that is causing the problem?
Did you bind flagReport or flagReported to the VF page with a merge field? a getter might be executing for these lists on load. try returning a list with one item in the getter for flagReport to confirm the issue first. You might be instantiating in your constructor but it is a parameterized constructor. Not sure but chances might be that it is executing default constructor and not finding your list instantiated. Just a thought.... So try some thing like this to confirm the issue...
In both of the queries in the constructor you are assuming that there will be at least one record that satisfies the criterial - is this guaranteed to be the case?
From the sound of it you aren't able to catch it though. If that is the case you'd do better to extract a list and check the size, something like: