Skip to content

Commit caf0757

Browse files
committed
Remove Debug.Assert
1 parent 4449f81 commit caf0757

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

PdfSharpCore/Drawing/XForm.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,11 @@ internal virtual void Finish()
180180
if (_formState == FormState.NotATemplate || _formState == FormState.Finished)
181181
return;
182182

183-
Debug.Assert(_formState == FormState.Created || _formState == FormState.UnderConstruction);
183+
if (!(_formState == FormState.Created || _formState == FormState.UnderConstruction))
184+
{
185+
throw new InvalidOperationException("Expected the form to be Created or UnderConstruction");
186+
}
187+
184188
_formState = FormState.Finished;
185189
Gfx.Dispose();
186190
Gfx = null;
@@ -189,7 +193,6 @@ internal virtual void Finish()
189193
{
190194
//pdfForm.CreateStream(PdfEncoders.RawEncoding.GetBytes(PdfRenderer.GetContent()));
191195
PdfRenderer.Close();
192-
Debug.Assert(PdfRenderer == null);
193196

194197
if (_document.Options.CompressContentStreams)
195198
{

0 commit comments

Comments
 (0)