Uploaded image for project: 'MediaPortal 1'
  1. MediaPortal 1
  2. MP1-4491

Silent exception in GUISettings Setpin() if the PIN is not a number

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major Major
    • 1.8.100
    • 1.7.1
    • Settings
    • None

    Description

      <ol>
      <li>Go to Settings UI</li>
      <li>Select the PIN (this is the global settings PIN)</li>
      <li>Enter a non number PIN (password)</li>
      <li>The PIN is not stored because of a silent exception (not logged)</li>
      </ol>

      <p>&nbsp;</p>

      <pre class="brush: csharp;" name="code" style="background-color:#f7f7f7;border:1px solid #d7d7d7;padding:.5em 1em .5em 1em;">
          private bool SetPin()
          {
            var msgGetPassword = new GUIMessage(GUIMessage.MessageType.GUI_MSG_GET_PASSWORD, 0, 0, 0, 0, 0, 0);
            GUIWindowManager.SendMessage(msgGetPassword);
              
            try
            {
              int iPincode = Int32.Parse(msgGetPassword.Label);
              _pin = iPincode.ToString(CultureInfo.InvariantCulture);
              return true;
            }
            // ReSharper disable EmptyGeneralCatchClause
            catch (Exception) {}
            // ReSharper restore EmptyGeneralCatchClause
            return false;
          }</pre>

      <p>&nbsp;</p>

      Attachments

        Activity

          People

            regeszter regeszter (Inactive)
            regeszter regeszter (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: