If your camera is becoming Null, Unity itself should be complaining in its error log, and not require the try-catch thing you have going on there. I don't know that I trust the results myself...
With that, I find interesting,
Quote:
black screen after some time
Does the camera work, and then not? If it
is working initially, what conditions are leading to it eventually being nullified? Does your code have access to that camera?
There are a range of questions and possibilities to consider, and the sample code isn't particularly helpful.
What
is helpful is doing what Griff suggested, and utilize the debugger. If you don't understand how, (we've all been there) take some time to figure it out. By doing so and gathering the results, you'll either:
A) Figure it out yourself, and learn along the way.
B) Give the people you seek aid from information to better help them help you.