1
0
Fork 0
mirror of https://github.com/vanitasvitae/Spherical synced 2025-09-11 03:09:47 +02:00

Fix NPE, add permission for external storage

This commit is contained in:
vanitasvitae 2017-09-13 14:51:35 +02:00
parent 179d3b7bd2
commit a6f93088df
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311
3 changed files with 23 additions and 8 deletions

View file

@ -115,12 +115,15 @@ public class SphereParser {
byte[] xml = new byte[xmlLen - 2];
i = inputStream.read(xml);
throwIfUnexpectedEOF(i, r.length);
throwIfUnexpectedEOF(i, xml.length);
return new String(xml);
}
public static PhotoSphereMetadata parse(String xmp) {
if (xmp == null) {
return null;
}
PhotoSphereMetadata meta = new PhotoSphereMetadata();
meta.setUsePanoramaViewer(parseBoolean(USE_PANORAMA_VIEWER, xmp, true));
meta.setCaptureSoftware(parseString(CAPTURE_SOFTWARE, xmp));