Skip to content

export gp7 throws exception #1025

@yibo7

Description

@yibo7

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

export gp7 throws exception “System.NullReferenceException:“Object reference not set to an instance of an object.”

The calling code is as follows

var exporter = new AlphaTab.Exporter.Gp7Exporter();
            var settings = new Settings();
            settings.Importer.Encoding = "utf-8";
            AlphaTab.Core.EcmaScript.Uint8Array data = exporter.Export(score, settings);
            ArraySegment<byte> bytes = data.Data;
            string fileName = score.Title.Length > 0 ? score.Title + ".gp" : "Untitled.gp";
            var info = new FileInfo(sPath);
            string savePath = Path.Combine(info.DirectoryName, fileName);

            using (var fs = new System.IO.FileStream(savePath, System.IO.FileMode.Create))
            {
                fs.Write(bytes.Array, bytes.Offset, bytes.Count);
            }

Expected Behavior

Hope to export the gp file correctly

Steps To Reproduce

1.select the gtp file in test-gtp-files.zip

2.call Gp7Exporter of the *.Export(score, settings)

Link to jsFiddle, CodePen, Project

No response

Found in Version

1.2

Platform

.net (WinForms)

Environment

- **Windows 10**:
- **WinForm**:
- **.net 6**:

Anything else?

test-gtp-files.zip

image

Metadata

Metadata

Assignees

Labels

area-coreRelated to some core parts of alphaTabplatform-allAffects all platformsstate-acceptedThis is a valid topic to work on.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions