jitsi / jitsi-android

Jitsi for Android is an Android port of the Jitsi project: The most feature-rich communicator with support for encrypted audio/video, chat and presence over SIP and XMPP
Apache License 2.0
415 stars 258 forks source link

PresenceStatusActivity: Close FileInputStream after use #5

Closed sandy-8925 closed 10 years ago

paweldomas commented 10 years ago

Nice catch ! But as we're on fixing it... Can we also move the check for Avatar operation set to the front before we start any processing ? And "fin" should be probably closed in finally block(with check for null value of "fin"). Thanks !

sandy-8925 commented 10 years ago

Ok.

I tried placing fin.close inside the finally block at first, but since it wouldn't have been initialized and initializing throws an exception, I thought that the statement would be better off at the end of the try block.

I will make the change.

I am also of the opinion that this code to read the avatar file should be moved out into a separate method and called from here.

On Tue, Feb 11, 2014 at 11:48 PM, Paweł Domas notifications@github.comwrote:

Nice catch ! But as we're on fixing it... Can we also move the check for Avatar operation set to the front before we start any processing ? And "fin" should be probably closed in finally block(with check for null value of "fin"). Thanks !

— Reply to this email directly or view it on GitHubhttps://github.com/jitsi/jitsi-android/pull/5#issuecomment-34846254 .