I prefer to enclose it in if statement so if stream null no need to run close
````
if(stream != null){
    stream.close();
}
````