galArgumentException</code></pre><span class="top-right-position"><span class="copy-icon"></span><div class="copy-popup-wrapper popup-to-left"><span class="copy-popup-icon"></span><span>Content copied to clipboard</span></div></span></div><p class="paragraph">You can use the <a href="to-negative-int-or-null.html">toNegativeIntOrNull</a> function for returning <code class="lang-kotlin">null</code> instead of throwing an <a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-illegal-argument-exception/