Panagiotis Triantafyllou

revert session impl, crash fixes

......@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
ext {
PUBLISH_GROUP_ID = 'ly.warp'
PUBLISH_VERSION = '4.5.4.6rc40'
PUBLISH_VERSION = '4.5.4.6rc41'
PUBLISH_ARTIFACT_ID = 'warply-android-sdk'
}
......
......@@ -119,7 +119,7 @@ public class DiskBasedCache implements Cache {
byte[] data = streamToBytes(cis, (int) Math.abs((int)(file.length() - cis.bytesRead)));
// byte[] data = readAllBytes(cis);
return entry.toCacheEntry(data);
} catch (IOException e) {
} catch (IOException | NegativeArraySizeException e) {
VolleyLog.d("%s: %s", file.getAbsolutePath(), e.toString());
remove(key);
return null;
......@@ -315,11 +315,11 @@ public class DiskBasedCache implements Cache {
/**
* Reads the contents of an InputStream into a byte[].
* */
private static byte[] streamToBytes(InputStream in, int length) throws IOException {
private static byte[] streamToBytes(InputStream in, int length) throws IOException, NegativeArraySizeException {
byte[] bytes = new byte[1];
try {
bytes = IOUtils.toByteArray(in);
} catch (OutOfMemoryError e) {
} catch (OutOfMemoryError | NegativeArraySizeException e) {
e.printStackTrace();
}
int count;
......
......@@ -63,7 +63,7 @@ public class WarplyProperty {
Properties properties = new Properties();
properties.load(context.getResources().getAssets().open(PROPERTIES_FILE));
return properties.getProperty(propertyKey);
} catch (IOException e) {
} catch (IOException | NullPointerException e) {
WarpUtils.log(e.getMessage());
return "";
}
......