Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply these styles to page => Exception #1662

Closed
nhwCoder opened this issue Nov 8, 2024 · 3 comments · Fixed by #1693
Closed

Apply these styles to page => Exception #1662

nhwCoder opened this issue Nov 8, 2024 · 3 comments · Fixed by #1693
Assignees
Labels
bug Something isn't working released Available in a released installer

Comments

@nhwCoder
Copy link

nhwCoder commented Nov 8, 2024

Problem to Solve

After using OneNote WebClipper to savwe a webpage I tried to use "Apply these styles to page" with default Confluence7 style to the created OneNote page, but always get "Exception: Error running command ApplyStylesCommen. See log files"

I reduced the page to a very simple sample and added it below as XML to (hopefully be able to) reproduce the error.

<one:Page xmlns:one="http://schemas.microsoft.com/office/onenote/2013/onenote" ID="{2FAD9858-D842-EDAD-3752-C34C73B5EA68}{1}{E19573999834251112987820132096460176099923811}" name="Aaa1" dateTime="2024-11-07T10:08:48.000Z" lastModifiedTime="2024-11-08T16:42:14.000Z" pageLevel="1" isCurrentlyViewed="true" selected="partial" lang="de">
  <one:QuickStyleDef index="0" name="PageTitle" fontColor="automatic" font="Calibri Light" fontSize="20.0" spaceBefore="0.0" spaceAfter="0.0" />
  <one:QuickStyleDef index="1" name="h1" fontColor="#1E4E79" highlightColor="automatic" font="Calibri" fontSize="14.0" spaceBefore="0.0" spaceAfter="0.0" />
  <one:QuickStyleDef index="2" name="h2" fontColor="#2E75B5" highlightColor="automatic" font="Calibri" fontSize="14.0" spaceBefore="0.0" spaceAfter="0.0" />
  <one:QuickStyleDef index="3" name="p" fontColor="automatic" highlightColor="automatic" font="Calibri" fontSize="11.0" spaceBefore="0.0" spaceAfter="0.0" />
  <one:PageSettings RTL="false" color="automatic" omHash="143474652886728101091952602609968742587923859036">
    <one:PageSize>
      <one:Automatic />
    </one:PageSize>
    <one:RuleLines visible="false" />
  </one:PageSettings>
  <one:Title lang="de" omHash="637702064868766363660441868649153519796274947118">
    <one:OE alignment="left" quickStyleIndex="0" style="font-family:'Calibri Light';font-size:20.0pt">
      <one:T><![CDATA[Aaa1]]></one:T>
    </one:OE>
  </one:Title>
  <one:Outline omHash="553350118779083610918328854500235409753293783327">
    <one:Position x="36.0" y="90.0" z="0" />
    <one:Size width="83.54290771484375" height="34.17968368530273" />
    <one:OEChildren>
      <one:OE alignment="left" quickStyleIndex="1">
        <one:T><![CDATA[1. aaa]]></one:T>
      </one:OE>
      <one:OE alignment="left" quickStyleIndex="2">
        <one:T><![CDATA[1.1. aaa]]></one:T>
      </one:OE>
    </one:OEChildren>
  </one:Outline>
  <one:Outline selected="partial" omHash="-259979942671739511864287631799708705895936906647">
    <one:Position x="198.0" y="392.3999938964844" z="1" />
    <one:Size width="72.0" height="13.42773056030273" />
    <one:OEChildren selected="partial">
      <one:OE alignment="left" quickStyleIndex="3" selected="partial">
        <one:T selected="all"><![CDATA[]]></one:T>
      </one:OE>
    </one:OEChildren>
  </one:Outline>
</one:Page>
@nhwCoder nhwCoder added bug Something isn't working unread I have seen it or had time to refine it yet labels Nov 8, 2024
@stevencohn stevencohn added no-repro Cannot reproduce and removed unread I have seen it or had time to refine it yet labels Nov 9, 2024
@stevencohn
Copy link
Owner

Can you attach the log file please? %temp%\OneMore.log

@nhwCoder
Copy link
Author

18|05:59:47.825| Running command ApplyStylesCommand
18|05:59:47.903| Error running command ApplyStylesCommand
18|05:59:47.903| System.NullReferenceException
Message: Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.
#[ADDED].[EN] Object reference not set to an instance of an object
Source: River.OneMoreAddIn
StackTrace: bei River.OneMoreAddIn.Commands.ApplyStylesCommand.ApplyStyles(List`1 styles)
bei River.OneMoreAddIn.Commands.ApplyStylesCommand.ApplyThemeStyles()
bei River.OneMoreAddIn.Commands.ApplyStylesCommand.d__6.MoveNext()
--- Ende der Stapelüberwachung vom vorhergehenden Ort, an dem die Ausnahme ausgelöst wurde ---
bei System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
bei River.OneMoreAddIn.Commands.ApplyStylesCommand.d__6.MoveNext()
--- Ende der Stapelüberwachung vom vorhergehenden Ort, an dem die Ausnahme ausgelöst wurde ---
bei System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
bei System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
bei System.Runtime.CompilerServices.TaskAwaiter.GetResult()
bei River.OneMoreAddIn.CommandFactory.d__6.MoveNext()
TargetSite: [River.OneMoreAddIn] River.OneMoreAddIn.Commands.ApplyStylesCommand::ApplyStyles()

@nhwCoder
Copy link
Author

nhwCoder commented Nov 29, 2024

Now I understand how to reproduce the exception always

STEPS

  • Use webbrowser extension "OneNote WebClipper" to save any webpage (as article) to OneNote
  • Apply any My Style file (e.g. Confluence7) with: My Styles\Apply These Styles To Page
    RESULT: Exception "Object reference not set to an instance of an object" (like sample above).

HINT: Even removing all content (inluding title) from such a WebClipper created page results in the Exception message!

@stevencohn stevencohn removed the no-repro Cannot reproduce label Nov 30, 2024
stevencohn added a commit that referenced this issue Nov 30, 2024
stevencohn added a commit that referenced this issue Nov 30, 2024
* Set missing highlightColor attribute
#1662

* delaunch
@stevencohn stevencohn linked a pull request Nov 30, 2024 that will close this issue
@stevencohn stevencohn added the next-release Addressed but not yet released label Nov 30, 2024
@stevencohn stevencohn self-assigned this Nov 30, 2024
@stevencohn stevencohn added released Available in a released installer and removed next-release Addressed but not yet released labels Dec 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released Available in a released installer
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants