Download notification fix.

This commit is contained in:
Dmitry Yunitsky 2014-08-05 16:32:05 +03:00 committed by Alex Zolotarev
parent 1f3b3f3d26
commit 69d65a9066

View file

@ -156,7 +156,7 @@ public class WorkerService extends IntentService
{
final LocationManager manager = (LocationManager) getApplication().getSystemService(Context.LOCATION_SERVICE);
final Location l = manager.getLastKnownLocation(LocationManager.PASSIVE_PROVIDER);
if (!LocationUtils.isExpired(l, l.getTime(), LocationUtils.LOCATION_EXPIRATION_TIME_MILLIS_LONG))
if (l != null && !LocationUtils.isExpired(l, l.getTime(), LocationUtils.LOCATION_EXPIRATION_TIME_MILLIS_LONG))
{
placeDownloadNotification(l);
return true;