Skip to content

Commit

Permalink
Merge pull request #127 from buchizo/fix-nullref-singleeach
Browse files Browse the repository at this point in the history
fix null ref exception of singleEach on wakeup
  • Loading branch information
buchizo authored Aug 18, 2022
2 parents 8862f8e + 9f9a5f8 commit 4f616c9
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ClaudiaIDE/source.extension.vsixmanifest
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
<Metadata>
<Identity Id="ClaudiaIDE..7442ac19-889b-4699-a817-e6e054877ee3" Version="3.1.1" Language="en-US" Publisher="buchizo" />
<Identity Id="ClaudiaIDE..7442ac19-889b-4699-a817-e6e054877ee3" Version="3.1.2" Language="en-US" Publisher="buchizo" />
<DisplayName>ClaudiaIDE</DisplayName>
<Description xml:space="preserve">This extension change the background image of editor.</Description>
<MoreInfo>https://github.com/buchizo/ClaudiaIDE</MoreInfo>
Expand Down
2 changes: 1 addition & 1 deletion ClaudiaIDE16/source.extension.vsixmanifest
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
<Metadata>
<Identity Id="ClaudiaIDE2019.9ab800ef-0cff-4893-bf16-57d58ff53456" Version="3.1.1" Language="en-US" Publisher="k.buchi" />
<Identity Id="ClaudiaIDE2019.9ab800ef-0cff-4893-bf16-57d58ff53456" Version="3.1.2" Language="en-US" Publisher="k.buchi" />
<DisplayName>ClaudiaIDE 2019</DisplayName>
<Description xml:space="preserve">This extension change the background image of editor.</Description>
<MoreInfo>https://github.com/buchizo/ClaudiaIDE</MoreInfo>
Expand Down
2 changes: 1 addition & 1 deletion Shared/ClaudiaIdePackage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
namespace ClaudiaIDE
{
[PackageRegistration(UseManagedResourcesOnly = true, AllowsBackgroundLoading = true)]
[InstalledProductRegistration("#110", "#112", "3.1.1", IconResourceID = 400)]
[InstalledProductRegistration("#110", "#112", "3.1.2", IconResourceID = 400)]
[ProvideOptionPage(typeof(ClaudiaIdeOptionPageGrid), "ClaudiaIDE", "General", 110, 116, true)]
[Guid(GuidList.PackageId)]
[ProvideAutoLoad("{ADFC4E65-0397-11D1-9F4E-00A0C911004F}",
Expand Down
11 changes: 11 additions & 0 deletions Shared/ImageProviders/SingleImageEachProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ private ImageFiles GetImagesFromDirectory()

public override BitmapSource GetBitmap()
{
if (_imageFiles == null)
{
_imageFiles = GetImagesFromDirectory();
_imageFilesPath = _imageFiles.GetEnumerator();
_imageFilesPath.MoveNext();
}
var current = _imageFilesPath?.Current;
if (string.IsNullOrEmpty(current)) return null;

Expand Down Expand Up @@ -68,6 +74,11 @@ protected override void OnSettingChanged(object sender, EventArgs e)

public void NextImage()
{
if (_imageFiles == null)
{
_imageFiles = GetImagesFromDirectory();
_imageFilesPath = _imageFiles.GetEnumerator();
}
if (!_imageFilesPath.MoveNext())
if (Setting.LoopSlideshow)
{
Expand Down

0 comments on commit 4f616c9

Please sign in to comment.