Skip to content

Commit

Permalink
fix(Notifications): cannot now create infinite notifications without …
Browse files Browse the repository at this point in the history
…context
  • Loading branch information
Iam1337 committed Sep 7, 2021
1 parent 3ba9e8c commit 6a60bae
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Assets/extDebug/Scripts/Notifications/DN.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

using UnityEngine;

using System;
using System.Collections.Generic;

namespace extDebug.Notifications
Expand Down Expand Up @@ -50,6 +51,9 @@ public static void Notify(object context, string text, float duration = kDuratio
return;
}

if (context == null && duration < 0)
throw new Exception("[DN.Notify] Cannot declare infinite notification without context.");

notice = new DNNotice();
notice.Text = text;
notice.Size = Render.CalcSize(text);
Expand Down

0 comments on commit 6a60bae

Please sign in to comment.