File tree Expand file tree Collapse file tree 2 files changed +8
-7
lines changed 
src/main/java/net/kyori/option Expand file tree Collapse file tree 2 files changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -142,7 +142,7 @@ interface Builder {
142142     * @param <V> the value type 
143143     * @since 1.0.0 
144144     */ 
145-     <V > Builder  value (final  Option <V > option , final  V  value );
145+     <V > Builder  value (final  Option <V > option , final  @ Nullable   V  value );
146146
147147    /** 
148148     * Apply all values from the existing option state. 
Original file line number Diff line number Diff line change @@ -176,15 +176,16 @@ public OptionState build() {
176176    }
177177
178178    @ Override 
179-     public  <V > Builder  value (final  Option <V > option , final  V  value ) {
180-       if  (!this .schema .has (option )) {
179+     public  <V > Builder  value (final  Option <V > option , final  @ Nullable   V  value ) {
180+       if  (!this .schema .has (requireNonNull ( option ,  "option" ) )) {
181181        throw  new  IllegalStateException ("Option '"  + option .id () + "' was not present in active schema" );
182182      }
183183
184-       this .values .put (
185-         requireNonNull (option , "flag" ),
186-         requireNonNull (value , "value" )
187-       );
184+       if  (value  == null ) {
185+         this .values .remove (option );
186+       } else  {
187+         this .values .put (option , value );
188+       }
188189      return  this ;
189190    }
190191
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments