Panagiotis Triantafyllou

crash fixes

......@@ -1586,8 +1586,8 @@ public enum Warply {
}
}
if (INSTANCE.mRequestQueue == null)
INSTANCE.mRequestQueue = Volley.newRequestQueue(mContext);
if (INSTANCE.mRequestQueue == null && INSTANCE.mContext != null)
INSTANCE.mRequestQueue = Volley.newRequestQueue(INSTANCE.mContext);
if (tempAnalytics != null && tempAnalytics.length() > 0) {
String urlAnalytics = WarplyProperty.getBaseUrl(mContext) + WarpConstants.WARPLY_ASYNC + WarpConstants.WARPLY_ANALYTICS + WarplyProperty.getAppUuid(mContext) + "/";
......
......@@ -659,6 +659,7 @@ public class WarpView extends WebView implements DefaultLifecycleObserver {
private void checkForPermissions(String origin, Callback callback) {
String perm = Manifest.permission.ACCESS_FINE_LOCATION;
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M || getContext().checkSelfPermission(perm) == PackageManager.PERMISSION_GRANTED) {
geolocationCallback = callback;
if (isGPSEnabled()) {
callback.invoke(origin, true, false);
} else {
......@@ -678,6 +679,8 @@ public class WarpView extends WebView implements DefaultLifecycleObserver {
}
private void enableLocationSettings() {
if (geolocationCallback == null) return;
GoogleApiClient googleApiClient = new GoogleApiClient.Builder(WarpActivity)
.addApi(LocationServices.API)
.build();
......