Skip to content

Commit

Permalink
Fixed an exception about the external storage and an issue related to…
Browse files Browse the repository at this point in the history
… BitmapImage in release mode.
  • Loading branch information
phongcao committed Feb 21, 2017
1 parent 5ea8da6 commit 64ec839
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.
17 changes: 4 additions & 13 deletions ImagePipeline/FBCore/Common/Statfs/StatFsHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -112,19 +112,10 @@ private void EnsureInitialized()
{
_internalPath = ApplicationData.Current.LocalFolder;

try
{
if (!KnownFolders.RemovableDevices.Path.Equals(string.Empty))
{
_externalPath = KnownFolders.RemovableDevices.GetFoldersAsync().GetAwaiter().GetResult().FirstOrDefault();
}
}
catch (UnauthorizedAccessException)
{
// No permission, 'Removable Storage' may not be checked in the app manifest
_externalPath = null;
}

// Phong Cao: Checking external storage requires 'Removable devices' permission in the
// app manifest, skip it for now
_externalPath = null;

UpdateStats();
_initialized = true;
}
Expand Down
2 changes: 1 addition & 1 deletion ImagePipeline/ImagePipeline/Core/ImagePipelineCore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ await DispatcherHelpers.RunOnDispatcherAsync(async () =>
using (var outStream = new InMemoryRandomAccessStream())
using (var writeStream = outStream.AsStreamForWrite())
{
await writeStream.WriteAsync(bytesArray, 0, supportedSize).ConfigureAwait(false);
await writeStream.WriteAsync(bytesArray, 0, supportedSize);
outStream.Seek(0);
BitmapImage bitmapImage = new BitmapImage();
await bitmapImage.SetSourceAsync(outStream).AsTask().ConfigureAwait(false);
Expand Down

0 comments on commit 64ec839

Please sign in to comment.