Skip to content

Commit

Permalink
Fix for empty values
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthijsFavorel committed Jan 23, 2025
1 parent d173d73 commit 829311c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion SLC-GQIO-ParseDateTime.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<Type>Automation</Type>
<Author>RGE</Author>
<CheckSets>FALSE</CheckSets>
<Folder></Folder>
<Folder>GQI/Operators</Folder>

<Protocols>
</Protocols>
Expand Down
4 changes: 2 additions & 2 deletions SLC-GQIO-ParseDateTime_1/Localization.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using System.Globalization;
using System;
using System;
using System.Globalization;
using System.Linq;

internal static class Localization
Expand Down
5 changes: 3 additions & 2 deletions SLC-GQIO-ParseDateTime_1/SLC-GQIO-ParseDateTime_1.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Skyline.DataMiner.Analytics.GenericInterface;
using System;
using System.Globalization;
using Skyline.DataMiner.Analytics.GenericInterface;

[GQIMetaData(Name = "Parse date/time")]
public sealed class DateTimeParser : IGQIColumnOperator, IGQIRowOperator, IGQIInputArguments
Expand Down Expand Up @@ -80,7 +80,8 @@ public void HandleColumns(GQIEditableHeader header)

public void HandleRow(GQIEditableRow row)
{
var stringValue = row.GetValue(_stringColumn);
if (!row.TryGetValue(_stringColumn, out var stringValue))
return;

if (!DateTime.TryParseExact(stringValue, _format, _culture, _dateTimeStyles, out var dateTimeValue))
return;
Expand Down

0 comments on commit 829311c

Please sign in to comment.