mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-12 16:09:37 -05:00
Fix build with older Java < 7
This commit is contained in:
parent
856ce2ffb1
commit
2095dae95d
@ -29,7 +29,7 @@ import android.content.Context;
|
|||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.app.ActivityManager;
|
import android.app.ActivityManager;
|
||||||
import java.util.Objects;
|
|
||||||
|
|
||||||
public class RetroShareServiceAndroid extends Service
|
public class RetroShareServiceAndroid extends Service
|
||||||
{
|
{
|
||||||
@ -70,8 +70,11 @@ public class RetroShareServiceAndroid extends Service
|
|||||||
public static Context getServiceContext()
|
public static Context getServiceContext()
|
||||||
{
|
{
|
||||||
if(sServiceContext == null)
|
if(sServiceContext == null)
|
||||||
|
{
|
||||||
Log.e(TAG, "getServiceContext() called before onCreate");
|
Log.e(TAG, "getServiceContext() called before onCreate");
|
||||||
return Objects.requireNonNull(sServiceContext);
|
throw new NullPointerException();
|
||||||
|
}
|
||||||
|
return sServiceContext;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user