mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-21 18:52:36 +01:00
Improve error handling
This commit is contained in:
parent
e864dbbe18
commit
7432536495
@ -1355,6 +1355,16 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
|
||||
var nsmgr = new XmlNamespaceManager(xml.NameTable);
|
||||
nsmgr.AddNamespace("ttml", "http://www.w3.org/ns/ttml");
|
||||
XmlNode head = xml.DocumentElement.SelectSingleNode("ttml:head", nsmgr);
|
||||
if (head == null)
|
||||
{
|
||||
head = xml.DocumentElement.SelectSingleNode("head", nsmgr);
|
||||
}
|
||||
|
||||
if (head == null)
|
||||
{
|
||||
return list;
|
||||
}
|
||||
|
||||
foreach (XmlNode node in head.SelectNodes("//ttml:style", nsmgr))
|
||||
{
|
||||
if (node.Attributes["xml:id"] != null)
|
||||
@ -1369,7 +1379,9 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
|
||||
}
|
||||
catch
|
||||
{
|
||||
// Ignore
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user